/* Rentvesting Calculator Styles - Mobile-First Design */

*,
*::before,
*::after {
    border-radius: 0 !important;
}

*::-webkit-scrollbar,
*::-webkit-scrollbar-thumb,
*::-webkit-scrollbar-track {
    border-radius: 0 !important;
}

.rentvesting {
    padding: 1.5rem 0 2rem;
    color: var(--text-color, #111827);
}

[data-theme="dark"] .rentvesting {
    color: var(--text-color, #f9fafb);
}

/* Header Section */
.rentvesting__header {
    margin-bottom: 1.5rem;
    display: grid;
    gap: 0.75rem;
}

.rentvesting__label {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.625rem;
    border-radius: 999px;
    background: var(--badge-bg, rgba(220, 38, 38, 0.1));
    color: var(--badge-text, #b91c1c);
    font-weight: 600;
    font-size: 0.8125rem;
    width: max-content;
}

[data-theme="dark"] .rentvesting__label {
    background: rgba(252, 165, 165, 0.16);
    color: #fca5a5;
}

.rentvesting__title {
    font-size: clamp(1.5rem, 5vw, 2.75rem);
    margin: 0;
    line-height: 1.2;
    color: var(--heading-color, #0f172a);
    word-wrap: break-word;
    hyphens: auto;
}

[data-theme="dark"] .rentvesting__title {
    color: var(--heading-color, #f8fafc);
}

.rentvesting__lede {
    max-width: 100%;
    font-size: 0.9375rem;
    line-height: 1.55;
    color: var(--text-secondary, #4b5563);
}

[data-theme="dark"] .rentvesting__lede {
    color: var(--text-secondary, #cbd5f5);
}

.rentvesting__meta {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: 0.875rem;
    color: var(--text-secondary, #4b5563);
}

.rentvesting__meta-label {
    display: block;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    font-size: 0.6875rem;
    color: var(--text-muted, #6b7280);
    margin-bottom: 0.125rem;
}

[data-theme="dark"] .rentvesting__meta {
    color: var(--text-secondary, #cbd5f5);
}

[data-theme="dark"] .rentvesting__meta-label {
    color: var(--text-muted, #94a3b8);
}

/* Layout - Mobile-First (Stacked) */
.rentvesting__layout {
    display: grid;
    gap: 1.5rem;
    grid-template-columns: 1fr;
}

/* Form Styles */
.rentvesting-form {
    display: grid;
    gap: 1.25rem;
}

.rentvesting-form fieldset {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 12px;
    padding: 1rem;
    background: var(--card-bg, #ffffff);
    box-shadow: 0 4px 12px rgba(15, 23, 42, 0.05);
    margin: 0;
}

[data-theme="dark"] .rentvesting-form fieldset {
    background: var(--card-bg, #0f172a);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 6px 16px rgba(2, 6, 23, 0.5);
}

.rentvesting-form legend {
    font-size: 1rem;
    font-weight: 600;
    padding: 0 0.5rem;
    color: var(--heading-color, #0f172a);
}

[data-theme="dark"] .rentvesting-form legend {
    color: var(--heading-color, #f8fafc);
}

/* Field Grid - Mobile-First (Single Column) */
.field-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.field-grid label {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    font-size: 0.875rem;
    font-weight: 500;
    color: var(--text-secondary, #374151);
    line-height: 1.4;
}

[data-theme="dark"] .field-grid label {
    color: var(--text-secondary, #cbd5f5);
}

/* Touch-Friendly Inputs (min 44px height for accessibility) */
.field-grid input {
    border: 1px solid var(--border-color, #e5e7eb);
    border-radius: 8px;
    padding: 0.75rem;
    font-size: 1rem;
    font-weight: 600;
    color: var(--text-color, #111827);
    background: var(--input-bg, #ffffff);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    min-height: 44px;
    -webkit-appearance: none;
    appearance: none;
}

.field-grid input:focus {
    border-color: var(--primary-color, #dc2626);
    box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.15);
    outline: none;
}

[data-theme="dark"] .field-grid input {
    background: rgba(15, 23, 42, 0.75);
    border-color: rgba(148, 163, 184, 0.35);
    color: var(--text-color, #f8fafc);
}

[data-theme="dark"] .field-grid input:focus {
    border-color: #f87171;
    box-shadow: 0 0 0 3px rgba(248, 113, 113, 0.25);
}

.field-note {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    line-height: 1.4;
    margin-top: -0.125rem;
}

[data-theme="dark"] .field-note {
    color: #94a3b8;
}

/* Results Section */
.rentvesting-results {
    background: linear-gradient(135deg, rgba(248, 250, 252, 0.95), rgba(255, 255, 255, 0.95));
    border: 1px solid var(--border-color, rgba(148, 163, 184, 0.35));
    border-radius: 14px;
    padding: 1.25rem;
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.1);
    display: grid;
    gap: 1.25rem;
}

[data-theme="dark"] .rentvesting-results {
    background: radial-gradient(circle at top left, rgba(30, 64, 175, 0.35), rgba(15, 23, 42, 0.85));
    border-color: rgba(59, 130, 246, 0.25);
}

.results-summary {
    display: grid;
    gap: 0.625rem;
}

.results-summary__badge {
    width: max-content;
    padding: 0.375rem 0.75rem;
    font-size: 0.75rem;
    border-radius: 999px;
    background: rgba(34, 197, 94, 0.15);
    color: #15803d;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.results-summary__badge.badge--negative {
    background: rgba(239, 68, 68, 0.15);
    color: #b91c1c;
}

[data-theme="dark"] .results-summary__badge {
    background: rgba(74, 222, 128, 0.18);
    color: #bbf7d0;
}

[data-theme="dark"] .results-summary__badge.badge--negative {
    background: rgba(248, 113, 113, 0.18);
    color: #fca5a5;
}

.results-summary__headline {
    margin: 0;
    font-size: clamp(1.25rem, 4vw, 2.1rem);
    color: var(--heading-color, #0f172a);
    line-height: 1.25;
    word-wrap: break-word;
    hyphens: auto;
}

[data-theme="dark"] .results-summary__headline {
    color: var(--heading-color, #f8fafc);
}

.results-summary__description {
    margin: 0;
    font-size: 0.875rem;
    line-height: 1.5;
    color: var(--text-secondary, #4b5563);
}

[data-theme="dark"] .results-summary__description {
    color: var(--text-secondary, #cbd5f5);
}

/* Results Grid - Mobile-First (Single Column) */
.results-grid {
    display: grid;
    gap: 1rem;
    grid-template-columns: 1fr;
}

.results-card,
.comparison-card {
    background: var(--card-bg, #ffffff);
    border-radius: 12px;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 6px 16px rgba(15, 23, 42, 0.08);
    display: grid;
    gap: 0.875rem;
}

[data-theme="dark"] .results-card,
[data-theme="dark"] .comparison-card {
    background: rgba(15, 23, 42, 0.7);
    border-color: rgba(148, 163, 184, 0.25);
    box-shadow: 0 8px 20px rgba(2, 6, 23, 0.5);
}

.results-card header p,
.results-card header h3,
.comparison-card header h3 {
    margin: 0;
}

.results-card header h3,
.comparison-card header h3 {
    font-size: 1rem;
    color: var(--heading-color, #0f172a);
    line-height: 1.3;
}

.results-card header p {
    font-size: 0.8125rem;
    color: var(--text-secondary, #4b5563);
    line-height: 1.4;
}

.results-card__metrics {
    display: grid;
    gap: 0.75rem;
    margin: 0;
}

.results-card__metrics > div {
    display: grid;
    gap: 0.25rem;
}

.results-card__metrics dt {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    color: var(--text-muted, #6b7280);
    line-height: 1.3;
}

.results-card__metrics dd {
    margin: 0;
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--heading-color, #0f172a);
    line-height: 1.3;
    word-break: break-word;
}

[data-theme="dark"] .results-card header h3,
[data-theme="dark"] .comparison-card header h3 {
    color: var(--heading-color, #f8fafc);
}

[data-theme="dark"] .results-card header p {
    color: var(--text-secondary, #cbd5f5);
}

[data-theme="dark"] .results-card__metrics dt {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .results-card__metrics dd {
    color: #f8fafc;
}

.comparison-card__list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    gap: 0.75rem;
}

.comparison-card__list li {
    display: grid;
    gap: 0.25rem;
}

.comparison-card__label {
    font-size: 0.75rem;
    color: var(--text-muted, #6b7280);
    text-transform: uppercase;
    letter-spacing: 0.03em;
    line-height: 1.3;
}

.comparison-card__value {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--heading-color, #0f172a);
    line-height: 1.3;
    word-break: break-word;
}

[data-theme="dark"] .comparison-card__label {
    color: rgba(226, 232, 240, 0.7);
}

[data-theme="dark"] .comparison-card__value {
    color: #f8fafc;
}

/* Value Formatting */
[data-format="currency"],
[data-format="currency-highlight"],
[data-format="delta"] {
    position: relative;
}

[data-format="currency"][data-full-value],
[data-format="currency-highlight"][data-full-value],
[data-format="delta"][data-full-value] {
    cursor: help;
}

[data-format="currency"].value--negative,
[data-format="currency-highlight"].value--negative,
[data-format="delta"].value--negative,
.comparison-card__value.value--negative {
    color: #b91c1c;
}

[data-format="currency"].value--positive,
[data-format="currency-highlight"].value--positive,
[data-format="delta"].value--positive,
.comparison-card__value.value--positive {
    color: #15803d;
}

[data-theme="dark"] [data-format="currency"].value--negative,
[data-theme="dark"] [data-format="currency-highlight"].value--negative,
[data-theme="dark"] [data-format="delta"].value--negative,
[data-theme="dark"] .comparison-card__value.value--negative {
    color: #f87171;
}

[data-theme="dark"] [data-format="currency"].value--positive,
[data-theme="dark"] [data-format="currency-highlight"].value--positive,
[data-theme="dark"] [data-format="delta"].value--positive,
[data-theme="dark"] .comparison-card__value.value--positive {
    color: #34d399;
}

/* Insight Panel */
.insight-panel {
    background: rgba(15, 23, 42, 0.85);
    color: #f8fafc;
    border-radius: 12px;
    padding: 1.25rem;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

.insight-panel h3 {
    margin: 0 0 0.5rem 0;
    font-size: 0.875rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.75);
}

.insight-panel p {
    margin: 0;
    font-size: 0.9375rem;
    line-height: 1.55;
}

[data-theme="dark"] .insight-panel {
    background: rgba(30, 41, 59, 0.92);
}

/* Content Section */
.rentvesting__content {
    margin-top: 2rem;
}

.rentvesting__copy {
    background: var(--card-bg, #ffffff);
    border-radius: 14px;
    padding: 1.25rem;
    border: 1px solid rgba(148, 163, 184, 0.2);
    box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
    line-height: 1.65;
}

[data-theme="dark"] .rentvesting__copy {
    background: rgba(15, 23, 42, 0.8);
    border-color: rgba(148, 163, 184, 0.3);
}

.rentvesting__copy h2 {
    color: var(--heading-color, #0f172a);
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.5rem;
    line-height: 1.3;
}

.rentvesting__copy h3 {
    color: var(--heading-color, #0f172a);
    margin-top: 1.25rem;
    margin-bottom: 0.625rem;
    font-size: 1.25rem;
    line-height: 1.3;
}

.rentvesting__copy p {
    margin-bottom: 1rem;
    color: var(--text-color, #111827);
    font-size: 0.9375rem;
}

.rentvesting__copy ul,
.rentvesting__copy ol {
    margin-bottom: 1rem;
    padding-left: 1.5rem;
    font-size: 0.9375rem;
}

.rentvesting__copy li {
    margin-bottom: 0.5rem;
}

[data-theme="dark"] .rentvesting__copy h2,
[data-theme="dark"] .rentvesting__copy h3 {
    color: var(--heading-color, #f8fafc);
}

[data-theme="dark"] .rentvesting__copy p {
    color: var(--text-color, #f9fafb);
}

/* Tooltip for full values - Desktop only */
@media (min-width: 768px) {
    [data-full-value]:hover::after {
        content: attr(data-full-value);
        position: absolute;
        bottom: 100%;
        left: 50%;
        transform: translateX(-50%);
        padding: 0.5rem 0.75rem;
        background: rgba(15, 23, 42, 0.95);
        color: white;
        border-radius: 8px;
        font-size: 0.875rem;
        white-space: nowrap;
        pointer-events: none;
        z-index: 100;
        margin-bottom: 0.5rem;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    }

    [data-theme="dark"] [data-full-value]:hover::after {
        background: rgba(30, 41, 59, 0.98);
    }
}

/* Tablet Breakpoint (640px+) */
@media (min-width: 640px) {
    .rentvesting {
        padding: 2rem 0 3rem;
    }

    .rentvesting__header {
        margin-bottom: 2rem;
        gap: 0.875rem;
    }

    .rentvesting__lede {
        font-size: 1rem;
    }

    .rentvesting__meta {
        flex-direction: row;
        gap: 1.25rem;
    }

    .field-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1.25rem;
    }

    .rentvesting-form fieldset {
        padding: 1.5rem;
    }

    .rentvesting__copy {
        padding: 1.75rem;
    }

    .rentvesting__copy p,
    .rentvesting__copy ul,
    .rentvesting__copy ol {
        font-size: 1rem;
    }
}

/* Desktop Breakpoint (1024px+) */
@media (min-width: 1024px) {
    .rentvesting {
        padding: 3rem 0 4rem;
    }

    .rentvesting__header {
        margin-bottom: 2.5rem;
        gap: 1rem;
    }

    .rentvesting__lede {
        max-width: 48rem;
        font-size: 1.1rem;
    }

    .rentvesting__meta {
        gap: 1.5rem;
    }

    /* Two-Column Layout */
    .rentvesting__layout {
        grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
        align-items: start;
        gap: 2rem;
    }

    .rentvesting-form {
        gap: 1.75rem;
    }

    .rentvesting-form fieldset {
        padding: 1.75rem;
        border-radius: 16px;
    }

    .rentvesting-form legend {
        font-size: 1.1rem;
    }

    .rentvesting-results {
        padding: 2rem;
        border-radius: 18px;
        gap: 1.75rem;
    }

    .results-summary {
        gap: 0.75rem;
    }

    .results-summary__description {
        font-size: 0.95rem;
        max-width: 40rem;
    }

    .results-card,
    .comparison-card {
        padding: 1.5rem;
        border-radius: 16px;
        gap: 1rem;
    }

    .results-card header h3,
    .comparison-card header h3 {
        font-size: 1.1rem;
    }

    .results-card header p {
        font-size: 0.9rem;
    }

    .results-card__metrics {
        gap: 0.85rem;
    }

    .results-card__metrics dt {
        font-size: 0.85rem;
    }

    .results-card__metrics dd {
        font-size: 1.35rem;
    }

    .comparison-card__list {
        gap: 0.85rem;
    }

    .comparison-card__label {
        font-size: 0.85rem;
    }

    .comparison-card__value {
        font-size: 1.25rem;
    }

    .insight-panel {
        padding: 1.5rem;
        border-radius: 16px;
    }

    .insight-panel h3 {
        font-size: 1rem;
    }

    .insight-panel p {
        font-size: 1.05rem;
        line-height: 1.6;
    }

    .rentvesting__content {
        margin-top: 3rem;
    }

    .rentvesting__copy {
        padding: 2rem;
        border-radius: 18px;
        line-height: 1.7;
    }
}

/* Large Desktop Breakpoint (1280px+) */
@media (min-width: 1280px) {
    .results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 1.5rem;
    }
}

/* Very Small Mobile Adjustments (< 375px) */
@media (max-width: 374px) {
    .rentvesting__title {
        font-size: 1.375rem;
    }

    .results-summary__headline {
        font-size: 1.125rem;
    }

    .rentvesting-form fieldset,
    .results-card,
    .comparison-card,
    .insight-panel {
        padding: 1rem;
    }

    .field-grid input {
        font-size: 0.9375rem;
    }

    .results-card__metrics dd,
    .comparison-card__value {
        font-size: 1rem;
    }
}
