/* ===== RESET & BASE ===== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --primary: #2563eb;
    --primary-dark: #1d4ed8;
    --primary-light: #dbeafe;
    --accent: #10b981;
    --accent-dark: #059669;
    --accent-light: #d1fae5;
    --orange: #f59e0b;
    --orange-light: #fef3c7;
    --purple: #8b5cf6;
    --purple-light: #ede9fe;
    --bg: #f1f5f9;
    --card: #ffffff;
    --text: #1e293b;
    --text-light: #64748b;
    --text-lighter: #94a3b8;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.05);
    --shadow: 0 1px 3px rgba(0,0,0,0.1), 0 1px 2px rgba(0,0,0,0.06);
    --shadow-md: 0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -2px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 15px -3px rgba(0,0,0,0.1), 0 4px 6px -4px rgba(0,0,0,0.1);
    --radius: 12px;
    --radius-sm: 8px;
    --transition: 0.2s ease;
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
}

a {
    color: var(--primary);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

.container {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    padding: 0 16px;
}

.container--wide {
    max-width: 1100px;
}

/* ===== NAVIGATION ===== */
.nav {
    background: var(--text);
    position: sticky;
    top: 0;
    z-index: 100;
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    max-width: 1100px;
    margin: 0 auto;
    height: 52px;
}

.nav__logo {
    color: white;
    font-weight: 800;
    font-size: 0.95rem;
    white-space: nowrap;
    text-decoration: none;
    letter-spacing: -0.01em;
}

.nav__logo:hover {
    text-decoration: none;
    opacity: 0.9;
}

.nav__links {
    display: none;
    list-style: none;
    gap: 0;
}

.nav__links a {
    color: rgba(255,255,255,0.8);
    font-size: 0.82rem;
    font-weight: 500;
    padding: 8px 12px;
    border-radius: 6px;
    transition: all var(--transition);
    text-decoration: none;
    white-space: nowrap;
}

.nav__links a:hover,
.nav__links a.active {
    color: white;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

.nav__burger {
    display: flex;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    margin-right: -8px;
}

.nav__burger span {
    display: block;
    width: 22px;
    height: 2px;
    background: white;
    border-radius: 2px;
    transition: all 0.3s;
}

.nav__burger.open span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}

.nav__burger.open span:nth-child(2) {
    opacity: 0;
}

.nav__burger.open span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile menu */
.nav__mobile {
    display: none;
    background: var(--text);
    padding: 8px 16px 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
}

.nav__mobile.open {
    display: block;
}

.nav__mobile a {
    display: block;
    color: rgba(255,255,255,0.8);
    font-size: 0.9rem;
    font-weight: 500;
    padding: 10px 12px;
    border-radius: 6px;
    transition: all var(--transition);
    text-decoration: none;
}

.nav__mobile a:hover,
.nav__mobile a.active {
    color: white;
    background: rgba(255,255,255,0.1);
    text-decoration: none;
}

/* ===== BREADCRUMBS ===== */
.breadcrumbs {
    padding: 12px 0;
    margin-bottom: 4px;
}

.breadcrumbs__list {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0;
    font-size: 0.78rem;
    color: var(--text-lighter);
}

.breadcrumbs__list li:not(:last-child)::after {
    content: '>';
    margin: 0 8px;
    color: var(--text-lighter);
}

.breadcrumbs__list a {
    color: var(--text-light);
    text-decoration: none;
}

.breadcrumbs__list a:hover {
    color: var(--primary);
    text-decoration: underline;
}

.breadcrumbs__list li:last-child {
    color: var(--text);
    font-weight: 600;
}

/* ===== HEADER ===== */
.header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 28px 0;
    text-align: center;
}

.header__title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
}

.header__subtitle {
    font-size: 0.95rem;
    opacity: 0.9;
    margin-top: 4px;
    font-weight: 400;
}

.badge {
    display: inline-block;
    background: rgba(255,255,255,0.2);
    padding: 2px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    vertical-align: middle;
}

/* ===== CALCULATOR LAYOUT ===== */
.calculator {
    margin-top: -12px;
    position: relative;
    z-index: 1;
}

.input-panel {
    background: var(--card);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow-md);
    margin-bottom: 16px;
}

.results-panel {
    margin-bottom: 24px;
}

/* ===== SALARY INPUT ===== */
.input-group--salary {
    margin-bottom: 20px;
}

.input-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.salary-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.salary-input {
    width: 100%;
    font-size: 2rem;
    font-weight: 700;
    color: var(--text);
    border: 2px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 12px 50px 12px 16px;
    background: var(--bg);
    transition: border-color var(--transition), box-shadow var(--transition);
    font-family: inherit;
    appearance: none;
    -moz-appearance: textfield;
}

.salary-input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 3px var(--primary-light);
}

.salary-currency {
    position: absolute;
    right: 16px;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-light);
    pointer-events: none;
}

.toggle-group--direction {
    margin-top: 10px;
}

/* ===== OPTIONS GRID ===== */
.options-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 12px;
}

.option-card {
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 14px;
}

.option-card--wide {
    margin-top: 12px;
}

.option-label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-light);
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

/* ===== TOGGLE BUTTONS ===== */
.toggle-group {
    display: flex;
    background: var(--card);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border);
}

.toggle-btn {
    flex: 1;
    padding: 8px 4px;
    border: none;
    background: transparent;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.toggle-btn.active {
    background: var(--primary);
    color: white;
}

.toggle-btn:not(.active):hover {
    background: var(--primary-light);
    color: var(--primary);
}

/* ===== RANGE SLIDER ===== */
.slider-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.slider-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
}

.range-slider {
    -webkit-appearance: none;
    appearance: none;
    width: 100%;
    height: 6px;
    background: var(--border);
    border-radius: 3px;
    outline: none;
    margin: 12px 0 8px;
    cursor: pointer;
}

.range-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    box-shadow: var(--shadow);
    transition: transform var(--transition), box-shadow var(--transition);
}

.range-slider::-webkit-slider-thumb:hover {
    transform: scale(1.15);
    box-shadow: var(--shadow-md);
}

.range-slider::-moz-range-thumb {
    width: 24px;
    height: 24px;
    background: var(--primary);
    border-radius: 50%;
    cursor: pointer;
    border: none;
    box-shadow: var(--shadow);
}

.slider-labels {
    display: flex;
    justify-content: space-between;
    font-size: 0.72rem;
    color: var(--text-lighter);
}

.slider-label-highlight {
    cursor: pointer;
    color: var(--primary);
    font-weight: 600;
}

.slider-label-highlight:hover {
    text-decoration: underline;
}

/* ===== PERIOD TABS ===== */
.period-tabs {
    display: flex;
    background: var(--bg);
    border-radius: var(--radius-sm);
    padding: 4px;
    margin-bottom: 16px;
}

.period-tab {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    border-radius: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-light);
    cursor: pointer;
    transition: all var(--transition);
    font-family: inherit;
}

.period-tab.active {
    background: var(--primary);
    color: white;
    box-shadow: var(--shadow-sm);
}

.period-tab:not(.active):hover {
    color: var(--primary);
    background: var(--primary-light);
}

/* ===== RESULT CARDS ===== */
.results-cards {
    display: grid;
    gap: 10px;
    margin-bottom: 16px;
}

.result-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 16px 18px;
    box-shadow: var(--shadow);
    display: flex;
    flex-direction: column;
    border-left: 4px solid transparent;
    transition: transform var(--transition), box-shadow var(--transition);
}

.result-card:hover {
    transform: translateY(-1px);
    box-shadow: var(--shadow-md);
}

.result-card--employer { border-left-color: var(--purple); }
.result-card--gross { border-left-color: var(--orange); }
.result-card--net { border-left-color: var(--primary); }
.result-card--netafter {
    border-left-color: var(--accent);
    background: linear-gradient(135deg, #ecfdf5 0%, #d1fae5 100%);
    border-left-width: 5px;
}

.result-card__label {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text-light);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.result-card__value {
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    margin: 4px 0 2px;
    letter-spacing: -0.02em;
    transition: color 0.3s;
}

.result-card--employer .result-card__value { color: var(--purple); }
.result-card--gross .result-card__value { color: var(--orange); }
.result-card--net .result-card__value { color: var(--primary); }
.result-card--netafter .result-card__value { color: var(--accent); font-size: 1.8rem; }
.result-card--netafter .result-card__label { color: var(--accent-dark); }

.result-card__sub {
    font-size: 0.75rem;
    color: var(--text-lighter);
}

/* ===== DETAILS ACCORDION ===== */
.details-accordion {
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    margin-bottom: 10px;
    overflow: hidden;
}

.details-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 14px 18px;
    font-size: 0.88rem;
    font-weight: 600;
    color: var(--text);
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.details-toggle::-webkit-details-marker {
    display: none;
}

.details-chevron {
    font-size: 0.7rem;
    color: var(--text-light);
    transition: transform 0.3s;
}

details[open] .details-chevron {
    transform: rotate(180deg);
}

.details-content {
    padding: 0 18px 16px;
}

/* ===== COTISATIONS TABLE ===== */
.cotisations-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.82rem;
}

.cotisations-table th {
    text-align: left;
    font-weight: 600;
    color: var(--text-light);
    padding: 8px 4px;
    border-bottom: 2px solid var(--border);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.cotisations-table th:not(:first-child) {
    text-align: right;
}

.cotisations-table td {
    padding: 7px 4px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.cotisations-table td:not(:first-child) {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
}

.cotisations-total td {
    font-weight: 700;
    border-bottom: none;
    border-top: 2px solid var(--text);
    padding-top: 10px;
    color: var(--text);
}

.tax-note {
    font-size: 0.75rem;
    color: var(--text-lighter);
    margin-top: 10px;
    font-style: italic;
}

/* ===== CONTENT PAGES ===== */
.page-header {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    padding: 32px 0;
}

.page-header__title {
    font-size: 1.6rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    margin-bottom: 8px;
}

.page-header__desc {
    font-size: 0.95rem;
    opacity: 0.9;
    max-width: 640px;
    line-height: 1.5;
}

.article-content {
    padding: 32px 0 48px;
}

.article-content h2 {
    font-size: 1.35rem;
    font-weight: 800;
    color: var(--text);
    margin: 32px 0 16px;
    letter-spacing: -0.01em;
}

.article-content h2:first-child {
    margin-top: 0;
}

.article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin: 24px 0 12px;
}

.article-content p {
    font-size: 0.95rem;
    color: var(--text-light);
    line-height: 1.75;
    margin-bottom: 16px;
}

.article-content ul,
.article-content ol {
    margin: 0 0 16px 24px;
    color: var(--text-light);
    font-size: 0.95rem;
    line-height: 1.75;
}

.article-content li {
    margin-bottom: 6px;
}

.article-content strong {
    color: var(--text);
}

/* Data tables in articles */
.data-table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
    background: var(--card);
    border-radius: var(--radius-sm);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    font-size: 0.88rem;
}

.data-table th {
    background: var(--primary);
    color: white;
    padding: 12px 16px;
    text-align: left;
    font-weight: 600;
    font-size: 0.82rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.data-table td {
    padding: 10px 16px;
    border-bottom: 1px solid var(--border);
    color: var(--text);
}

.data-table tr:last-child td {
    border-bottom: none;
}

.data-table tr:hover td {
    background: var(--bg);
}

.data-table td:not(:first-child) {
    font-variant-numeric: tabular-nums;
}

.data-table--highlight tr:last-child td {
    font-weight: 700;
    background: var(--primary-light);
    color: var(--primary-dark);
}

/* Highlight box */
.highlight-box {
    background: var(--primary-light);
    border-left: 4px solid var(--primary);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    padding: 18px 20px;
    margin: 24px 0;
}

.highlight-box p {
    color: var(--primary-dark);
    font-weight: 500;
    margin-bottom: 0;
}

.highlight-box strong {
    color: var(--primary-dark);
}

/* CTA card in articles */
.cta-card {
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
    color: white;
    border-radius: var(--radius);
    padding: 28px;
    margin: 32px 0;
    text-align: center;
}

.cta-card h3 {
    color: white;
    font-size: 1.15rem;
    margin-bottom: 8px;
}

.cta-card p {
    color: rgba(255,255,255,0.9);
    margin-bottom: 16px;
}

.cta-card a {
    display: inline-block;
    background: white;
    color: var(--primary-dark);
    padding: 10px 28px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    text-decoration: none;
    transition: transform var(--transition), box-shadow var(--transition);
}

.cta-card a:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
    text-decoration: none;
}

/* Internal link cards */
.related-links {
    display: grid;
    gap: 12px;
    margin: 32px 0;
}

.related-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px;
    background: var(--card);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-sm);
    text-decoration: none;
    transition: all var(--transition);
    border: 1px solid var(--border);
}

.related-link:hover {
    text-decoration: none;
    box-shadow: var(--shadow-md);
    transform: translateY(-1px);
    border-color: var(--primary);
}

.related-link__icon {
    font-size: 1.5rem;
    flex-shrink: 0;
}

.related-link__text {
    flex: 1;
}

.related-link__title {
    font-weight: 700;
    font-size: 0.92rem;
    color: var(--text);
}

.related-link__desc {
    font-size: 0.8rem;
    color: var(--text-light);
    margin-top: 2px;
}

/* FAQ section */
.faq-section {
    margin: 40px 0;
}

.faq-section h2 {
    margin-bottom: 16px;
}

.faq-item {
    background: var(--card);
    border-radius: var(--radius-sm);
    margin-bottom: 8px;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
}

.faq-item summary {
    padding: 16px 18px;
    font-weight: 600;
    font-size: 0.92rem;
    cursor: pointer;
    list-style: none;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: var(--text);
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item summary::after {
    content: '+';
    font-size: 1.2rem;
    color: var(--primary);
    font-weight: 700;
    flex-shrink: 0;
    transition: transform 0.3s;
}

.faq-item[open] summary::after {
    content: '-';
}

.faq-item__answer {
    padding: 0 18px 16px;
    font-size: 0.9rem;
    color: var(--text-light);
    line-height: 1.7;
}

/* ===== INFO SECTION ===== */
.info-section {
    margin-bottom: 40px;
}

.info-title {
    font-size: 1.3rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 20px;
    letter-spacing: -0.01em;
}

.info-grid {
    display: grid;
    gap: 12px;
}

.info-card {
    background: var(--card);
    border-radius: var(--radius-sm);
    padding: 18px;
    box-shadow: var(--shadow-sm);
}

.info-card h3 {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--primary-dark);
    margin-bottom: 8px;
}

.info-card p {
    font-size: 0.88rem;
    color: var(--text-light);
    line-height: 1.6;
}

/* ===== FOOTER ===== */
.footer {
    background: var(--text);
    color: rgba(255,255,255,0.6);
    padding: 28px 0;
}

.footer__inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px;
}

.footer__grid {
    display: grid;
    gap: 24px;
    margin-bottom: 20px;
}

.footer__col h4 {
    color: white;
    font-size: 0.85rem;
    font-weight: 700;
    margin-bottom: 10px;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.footer__col a {
    display: block;
    color: rgba(255,255,255,0.6);
    font-size: 0.82rem;
    padding: 3px 0;
    text-decoration: none;
    transition: color var(--transition);
}

.footer__col a:hover {
    color: white;
    text-decoration: none;
}

.footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.1);
    padding-top: 16px;
    font-size: 0.78rem;
    text-align: center;
    color: rgba(255,255,255,0.4);
}

/* ===== ANIMATIONS ===== */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

.result-card {
    animation: fadeIn 0.4s ease both;
}

.result-card:nth-child(1) { animation-delay: 0.05s; }
.result-card:nth-child(2) { animation-delay: 0.1s; }
.result-card:nth-child(3) { animation-delay: 0.15s; }
.result-card:nth-child(4) { animation-delay: 0.2s; }

.value-updated {
    animation: pulse 0.3s ease;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.03); }
    100% { transform: scale(1); }
}

/* ===== RESPONSIVE: TABLET ===== */
@media (min-width: 640px) {
    .container {
        padding: 0 24px;
    }

    .header {
        padding: 36px 0;
    }

    .header__title {
        font-size: 1.8rem;
    }

    .page-header__title {
        font-size: 1.9rem;
    }

    .results-cards {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .footer__grid {
        grid-template-columns: 1fr 1fr;
    }

    .related-links {
        grid-template-columns: 1fr 1fr;
    }
}

/* ===== RESPONSIVE: DESKTOP ===== */
@media (min-width: 1024px) {
    .container {
        padding: 0 32px;
    }

    .header__title {
        font-size: 2rem;
    }

    .nav__links {
        display: flex;
    }

    .nav__burger {
        display: none;
    }

    .calculator {
        display: grid;
        grid-template-columns: 380px 1fr;
        gap: 20px;
        align-items: start;
    }

    .input-panel {
        position: sticky;
        top: 72px;
        margin-bottom: 0;
    }

    .results-cards {
        grid-template-columns: 1fr 1fr;
    }

    .info-grid {
        grid-template-columns: 1fr 1fr 1fr;
    }

    .footer__grid {
        grid-template-columns: 2fr 1fr 1fr 1fr;
    }

    .related-links {
        grid-template-columns: 1fr 1fr 1fr;
    }
}

/* ===== ACCESSIBILITY ===== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

:focus-visible {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

button:focus:not(:focus-visible) {
    outline: none;
}
