.expat-tax {
    padding: 4rem 0 6rem;
    background: var(--surface-elevated, #0f172a);
    color: var(--text-on-dark, #f8fafc);
}

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

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

[data-theme="light"] .expat-tax {
    background: var(--bg-light, #f8fafc);
    color: var(--text-dark, #0f172a);
}

.expat-tax__header {
    max-width: 960px;
    margin: 0 auto 3rem;
    text-align: left;
}

.expat-tax__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    background: var(--teal-bg-dark, rgba(15, 118, 110, 0.16));
    color: var(--teal-light, #5eead4);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.75rem;
}

[data-theme="light"] .expat-tax__label {
    background: var(--teal-bg-light, rgba(15, 118, 110, 0.12));
    color: var(--teal-dark, #0f766e);
}

.expat-tax__title {
    margin: 1.5rem 0 1rem;
    font-size: clamp(2rem, 4vw, 2.75rem);
    font-weight: 700;
    line-height: 1.15;
}

.expat-tax__lede {
    font-size: 1.125rem;
    line-height: 1.7;
    max-width: 70ch;
    color: var(--text-light-muted, rgba(248, 250, 252, 0.85));
}

[data-theme="light"] .expat-tax__lede {
    color: var(--text-dark-muted, rgba(15, 23, 42, 0.82));
}

.expat-tax__meta {
    margin-top: 1.75rem;
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    padding: 0;
    list-style: none;
}

.expat-tax__meta-label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    opacity: 0.7;
    margin-bottom: 0.35rem;
}

.expat-tax__layout {
    display: grid;
    gap: 2rem;
    grid-template-columns: repeat(12, 1fr);
}

.expat-tax-form {
    grid-column: span 5;
    background: var(--form-bg-dark, rgba(15, 23, 42, 0.55));
    border-radius: 1.5rem;
    padding: 2rem;
    border: 1px solid var(--border-subtle, rgba(148, 163, 184, 0.16));
}

[data-theme="light"] .expat-tax-form {
    background: var(--form-bg-light, #ffffff);
    border: 1px solid var(--border-light, rgba(15, 23, 42, 0.08));
}

.expat-tax-form fieldset {
    border: none;
    margin: 0 0 2rem;
    padding: 0 0 2rem;
    border-bottom: 1px solid var(--border-subtle-dark, rgba(148, 163, 184, 0.15));
}

.expat-tax-form fieldset:last-of-type {
    border-bottom: none;
    padding-bottom: 0;
    margin-bottom: 0;
}

.expat-tax-form legend {
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--teal-light, #5eead4);
    margin-bottom: 1rem;
}

[data-theme="light"] .expat-tax-form legend {
    color: var(--teal-dark, #0f766e);
}

.field-grid {
    display: grid;
    gap: 1.5rem;
}

.field-grid label {
    display: flex;
    flex-direction: column;
    font-weight: 500;
    gap: 0.5rem;
}

.field-grid input,
.field-grid select {
    appearance: none;
    border-radius: 0.75rem;
    border: 1px solid var(--input-border, rgba(148, 163, 184, 0.35));
    background: var(--input-bg-dark, rgba(15, 23, 42, 0.55));
    padding: 0.85rem 1rem;
    color: inherit;
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

[data-theme="light"] .field-grid input,
[data-theme="light"] .field-grid select {
    background: var(--input-bg-light, rgba(15, 23, 42, 0.04));
}

.field-grid input:focus,
.field-grid select:focus {
    outline: none;
    border-color: var(--teal-focus, #14b8a6);
    box-shadow: 0 0 0 3px var(--teal-focus-shadow, rgba(20, 184, 166, 0.35));
}

.field-note {
    font-size: 0.85rem;
    color: var(--text-muted, rgba(148, 163, 184, 0.8));
}

[data-theme="light"] .field-note {
    color: var(--text-muted-light, rgba(15, 23, 42, 0.6));
}

.expat-tax-results {
    grid-column: span 7;
    background: var(--results-bg-gradient, linear-gradient(155deg, rgba(6, 182, 212, 0.12), rgba(59, 130, 246, 0.18)));
    border-radius: 1.75rem;
    padding: 2.5rem;
    border: 1px solid var(--results-border, rgba(125, 211, 252, 0.25));
    color: var(--results-text, #f8fafc);
}

[data-theme="light"] .expat-tax-results {
    background: var(--results-bg-gradient-light, linear-gradient(155deg, rgba(6, 182, 212, 0.09), rgba(59, 130, 246, 0.12)));
    color: var(--results-text-light, #0f172a);
    border-color: var(--results-border-light, rgba(59, 130, 246, 0.18));
}

.results-summary {
    margin-bottom: 2rem;
}

.results-summary__badge {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.9rem;
    border-radius: 999px;
    background: var(--badge-bg, rgba(8, 145, 178, 0.22));
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-size: 0.75rem;
}

.results-summary__headline {
    margin: 1rem 0 0.5rem;
    font-size: clamp(1.6rem, 3vw, 2.25rem);
}

.results-summary__description {
    max-width: 60ch;
    color: var(--results-desc-text, rgba(248, 250, 252, 0.8));
}

[data-theme="light"] .results-summary__description {
    color: var(--results-desc-text-light, rgba(15, 23, 42, 0.72));
}

.results-grid {
    display: grid;
    gap: 1.5rem;
}

.results-card {
    background: var(--card-bg-dark, rgba(15, 23, 42, 0.55));
    border-radius: 1.5rem;
    padding: 1.75rem;
    border: 1px solid var(--card-border, rgba(148, 163, 184, 0.18));
}

[data-theme="light"] .results-card {
    background: var(--card-bg-light, rgba(248, 250, 252, 0.92));
    border-color: var(--card-border-light, rgba(148, 163, 184, 0.2));
}

.results-card header h3 {
    margin: 0;
    font-size: 1.25rem;
    font-weight: 600;
}

.results-card header p {
    margin: 0.5rem 0 1.5rem;
    color: var(--card-text-muted, rgba(148, 163, 184, 0.85));
}

[data-theme="light"] .results-card header p {
    color: var(--card-text-muted-light, rgba(30, 41, 59, 0.7));
}

.results-card__metrics {
    display: grid;
    gap: 1.25rem;
}

.results-card__metrics dt {
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--metric-label, rgba(148, 163, 184, 0.75));
}

.results-card__metrics dd {
    margin: 0.35rem 0 0;
    font-size: 1.35rem;
    font-weight: 600;
}

[data-format="currency-highlight"] {
    color: var(--currency-highlight, #fcd34d);
}

[data-theme="light"] [data-format="currency-highlight"] {
    color: var(--currency-highlight-light, #b45309);
}

.insight-panel {
    margin-top: 2.5rem;
    padding: 1.75rem;
    border-radius: 1.25rem;
    background: var(--insight-bg, rgba(8, 145, 178, 0.16));
    border: 1px solid var(--insight-border, rgba(125, 211, 252, 0.35));
}

[data-theme="light"] .insight-panel {
    background: var(--insight-bg-light, rgba(125, 211, 252, 0.18));
    border-color: var(--insight-border-light, rgba(56, 189, 248, 0.35));
}

.insight-panel h3 {
    margin-top: 0;
    margin-bottom: 0.75rem;
    font-size: 1.1rem;
}

.insight-panel p {
    margin: 0;
    line-height: 1.6;
}

.expat-tax__content {
    margin-top: 4rem;
    background: var(--content-bg, #ffffff);
    border-radius: 2rem;
    padding: 3rem;
    color: var(--content-text, #0f172a);
}

[data-theme="dark"] .expat-tax__content {
    background: var(--content-bg-dark, rgba(15, 23, 42, 0.85));
    color: var(--content-text-dark, #e2e8f0);
}

.expat-tax__copy {
    max-width: 70ch;
    margin: 0 auto;
}

.expat-tax__copy h2,
.expat-tax__copy h3 {
    margin-top: 2.5rem;
    color: inherit;
}

.expat-tax__copy p,
.expat-tax__copy ul,
.expat-tax__copy ol {
    line-height: 1.8;
    margin-bottom: 1.25rem;
}

.expat-tax__copy ul,
.expat-tax__copy ol {
    padding-left: 1.5rem;
}

@media (min-width: 768px) {
    .field-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (min-width: 1024px) {
    .results-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 1023px) {
    .expat-tax__layout {
        grid-template-columns: 1fr;
    }

    .expat-tax-form,
    .expat-tax-results {
        grid-column: span 12;
    }
}

@media (max-width: 640px) {
    .expat-tax {
        padding: 3rem 0 4rem;
    }

    .expat-tax-form,
    .expat-tax-results {
        padding: 1.5rem;
    }

    .results-card {
        padding: 1.5rem;
    }

    .expat-tax__content {
        padding: 2rem;
    }
}
