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

:root {
    --red: #c0392b;
    --red-dark: #a93226;
    --yellow: #f1c40f;
    --yellow-dark: #d4ac0d;
    --text: #2c3e50;
    --text-light: #7f8c8d;
    --text-muted: #95a5a6;
    --bg: #ffffff;
    --bg-light: #f8f9fa;
    --bg-warm: #fdf6ee;
    --border: #e0e0e0;
    --border-light: #eee;
    --footer-bg: #f8f9fa;
    --radius: 8px;
}

html { scroll-behavior: smooth; }

body {
    font-family: 'Nunito', -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--text);
    background: var(--bg);
    line-height: 1.6;
    font-size: 15px;
    -webkit-font-smoothing: antialiased;
}

.container { max-width: 1200px; margin: 0 auto; padding: 0 24px; }

a { color: inherit; text-decoration: none; }

/* ==================== NAV ==================== */
.nav {
    background: var(--bg);
    padding: 16px 0;
    border-bottom: 1px solid var(--border-light);
}
.nav-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.logo {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text);
    letter-spacing: -0.02em;
}
.logo-icon { flex-shrink: 0; }

.nav-links {
    display: flex;
    gap: 24px;
    font-size: .9rem;
    color: var(--text-light);
}
.nav-links a:hover { color: var(--text); }

/* ==================== BREADCRUMB ==================== */
.breadcrumb {
    padding: 10px 0;
    font-size: .82rem;
    color: var(--text-muted);
    border-bottom: 1px solid var(--border-light);
}
.breadcrumb-item { color: var(--text-light); }
.breadcrumb-active { color: var(--text); font-weight: 600; }

/* ==================== PROMO BANNER ==================== */
.promo-banner {
    background: var(--text);
    padding: 8px 0;
    font-size: .82rem;
    color: #fff;
    text-align: center;
}
.promo-banner strong { color: var(--yellow); }

/* ==================== HERO TITLE ==================== */
.hero-title {
    background: var(--bg-light);
    padding: 28px 0;
    font-size: 1.6rem;
    font-weight: 800;
    color: var(--text);
    border-bottom: 1px solid var(--border-light);
}
.hero-title .container {
    display: flex;
    align-items: center;
}
.operator-logo-img {
    height: 22px;
    max-width: 120px;
    margin-right: 10px;
    object-fit: contain;
    vertical-align: middle;
}

/* ==================== MAIN CONTENT GRID ==================== */
.main-content { padding: 32px 0; }
.main-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
    align-items: start;
}

/* ==================== FORM ==================== */
.form-card {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
    background: var(--bg);
}
.form-section-title {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    margin-top: 20px;
}
.form-section-title:first-child { margin-top: 0; }

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.form-group { margin-bottom: 12px; }

.form-input {
    width: 100%;
    padding: 12px 14px;
    border: 1px solid var(--border);
    border-radius: 6px;
    font-family: inherit;
    font-size: .9rem;
    color: var(--text);
    background: var(--bg);
    transition: border-color .2s;
    outline: none;
}
.form-input::placeholder { color: var(--text-muted); }
.form-input:focus { border-color: var(--text); }

/* Radio buttons */
.radio-group { margin-bottom: 20px; }
.radio-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: .9rem;
    margin-bottom: 8px;
}
.radio-label input[type="radio"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    position: relative;
    cursor: pointer;
    flex-shrink: 0;
}
.radio-label input[type="radio"]:checked {
    border-color: var(--red);
}
.radio-label input[type="radio"]:checked::after {
    content: '';
    position: absolute;
    top: 3px; left: 3px;
    width: 8px; height: 8px;
    background: var(--red);
    border-radius: 50%;
}

/* Countdown */
.countdown-bar {
    background: #fef9e7;
    border: 1px solid #f9e79f;
    border-radius: 6px;
    padding: 10px 16px;
    font-size: .85rem;
    color: var(--text);
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.countdown-icon { font-size: 1.1rem; }

/* Submit button */
.btn-submit {
    width: 100%;
    padding: 16px;
    background: var(--red);
    color: #fff;
    border: none;
    border-radius: 6px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: .04em;
    cursor: pointer;
    transition: background .2s;
}
.btn-submit:hover { background: var(--red-dark); }

/* ==================== PREVIEW COLUMN ==================== */
.preview-column { position: sticky; top: 20px; }

.laposte-badge {
    background: var(--yellow);
    color: var(--text);
    border-radius: var(--radius);
    padding: 14px 24px;
    font-size: .95rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-bottom: 20px;
}
.laposte-badge strong { font-weight: 800; }
.laposte-logo-img { height: 14px; object-fit: contain; }

.letter-preview {
    border: 1px solid var(--border);
    border-radius: var(--radius);
    background: var(--bg);
    overflow: hidden;
}
.letter-content {
    padding: 28px;
    font-size: .82rem;
    line-height: 1.7;
    color: var(--text);
}
.letter-header-right { text-align: right; margin-bottom: 16px; }
.letter-operator-logo-img {
    height: 16px;
    max-width: 80px;
    object-fit: contain;
    margin-bottom: 4px;
}
.letter-header-right p { font-size: .8rem; line-height: 1.5; color: var(--text); }
.letter-spacer { height: 20px; }
.letter-spacer-sm { height: 10px; }
.letter-type { font-size: .8rem; color: var(--text-light); }
.letter-object { font-size: .85rem; }
.letter-blur {
    color: transparent;
    text-shadow: 0 0 6px rgba(0,0,0,.3);
    user-select: none;
}
.letter-highlight {
    background: var(--yellow);
    padding: 0 4px;
    border-radius: 2px;
    color: var(--text);
    font-weight: 700;
}

/* Sender block */
.letter-sender {
    font-size: .8rem;
    line-height: 1.6;
    margin-bottom: 8px;
}
.letter-date { font-size: .82rem; }

/* Dynamic fields */
.letter-field, .letter-field-sm {
    color: var(--text-muted);
    transition: color .3s;
}
.letter-field.letter-filled, .letter-field-sm.letter-filled {
    color: var(--text);
    font-weight: 700;
}

/* Date picker (hidden by default) */
#date-picker-group {
    display: none;
    margin-bottom: 12px;
}
#date-picker-group.visible {
    display: block;
}

/* ==================== FORM ERRORS ==================== */
.form-input-error {
    border-color: var(--red) !important;
    background: #fef2f2 !important;
}
.form-error {
    background: #fef2f2;
    color: var(--red);
    border: 1px solid #fecaca;
    border-radius: 6px;
    padding: 10px 14px;
    font-size: .85rem;
    font-weight: 600;
    margin-bottom: 16px;
}
.field-error-msg {
    color: var(--red);
    font-size: .78rem;
    margin-top: 4px;
    font-weight: 600;
}

/* ==================== BACK BUTTON ==================== */
.btn-back {
    background: none;
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text);
    font-family: inherit;
    font-size: .88rem;
    font-weight: 600;
    cursor: pointer;
    padding: 8px 14px;
    margin-bottom: 16px;
    transition: color .2s;
}
.btn-back:hover { background: var(--border-light); color: var(--text); }

/* ==================== OFFER RADIOS ==================== */
.offer-radios {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 24px;
}
.offer-radio {
    display: block;
    cursor: pointer;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    position: relative;
    transition: border-color .2s, background .2s;
}
.offer-radio:hover { border-color: #bbb; }
.offer-radio input[type="radio"] { display: none; }
.offer-radio input[type="radio"]:checked + .offer-radio-content { }
.offer-radio:has(input:checked) {
    border-color: var(--text);
    background: #f4f6f7;
}

.offer-radio-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.offer-radio-left { display: flex; flex-direction: column; gap: 2px; }
.offer-radio-name { font-size: .95rem; font-weight: 700; color: var(--text); }
.offer-radio-desc { font-size: .8rem; color: var(--text-muted); }
.offer-radio-price { font-size: 1.15rem; font-weight: 800; color: var(--text); white-space: nowrap; margin-left: 16px; }

.offer-radio-badge {
    position: absolute;
    top: -9px;
    right: 12px;
    background: var(--red);
    color: #fff;
    padding: 1px 10px;
    border-radius: 100px;
    font-size: .7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .03em;
}

/* ==================== STRIPE ELEMENTS ==================== */
#stripe-card-element {
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 12px 14px;
    margin-bottom: 12px;
    background: #fff;
    transition: border-color .2s;
}
#stripe-card-element.StripeElement--focus { border-color: var(--red); }
#stripe-card-element.StripeElement--invalid { border-color: var(--red); background: #fef2f2; }

/* Payment Request Button (Apple Pay / Google Pay) */
#payment-request-button { margin-bottom: 12px; }
.payment-separator {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
    color: var(--text-muted);
    font-size: .82rem;
}
.payment-separator::before,
.payment-separator::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

#btn-payer:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.payment-info {
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
    margin-top: 12px;
}

/* ==================== ARTICLE SECTION ==================== */
.article-section {
    padding: 48px 0;
    border-top: 1px solid var(--border-light);
}
.article-grid {
    display: grid;
    grid-template-columns: 360px 1fr;
    gap: 40px;
    align-items: start;
}

/* TOC Sidebar */
.sidebar { position: sticky; top: 20px; }
.toc-card {
    background: var(--bg-light);
    border-radius: var(--radius);
    padding: 24px;
    border: 1px solid var(--border-light);
}
.toc-title {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 16px;
}
.toc-list {
    list-style: none;
}
.toc-list > li { margin-bottom: 8px; }
.toc-list > li > a {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .88rem;
    font-weight: 600;
    color: var(--text);
    transition: color .2s;
}
.toc-list > li > a::before {
    content: '\2192';
    color: var(--text-muted);
    flex-shrink: 0;
}
.toc-list > li > a:hover { color: var(--text); }

.toc-list ul {
    list-style: none;
    padding-left: 22px;
    margin-top: 6px;
}
.toc-list ul li { margin-bottom: 4px; }
.toc-list ul li a {
    font-size: .82rem;
    font-weight: 400;
    color: var(--text-light);
    display: flex;
    align-items: center;
    gap: 6px;
}
.toc-list ul li a::before {
    content: '\2013';
    color: var(--text-muted);
}
.toc-list ul li a:hover { color: var(--text); }

/* Article Content */
.article-content {}
.article-intro {
    font-size: .95rem;
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 32px;
}
.article-content h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--red);
    margin: 36px 0 16px;
    text-align: left;
}
.article-content h3 {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text);
    margin: 24px 0 12px;
}
.article-content p {
    font-size: .93rem;
    color: var(--text);
    line-height: 1.8;
    margin-bottom: 14px;
}
.article-content ul {
    margin: 0 0 16px 20px;
}
.article-content ul li {
    font-size: .93rem;
    line-height: 1.8;
    margin-bottom: 4px;
}

.address-block {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: 6px;
    padding: 16px 20px;
    font-size: .93rem;
    line-height: 1.7;
    margin: 12px 0 16px;
}

/* ==================== SIMILAR SECTION ==================== */
.similar-section {
    padding: 40px 0;
}
.similar-card {
    background: var(--bg-light);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 32px;
}
.similar-card h3 {
    font-size: 1.15rem;
    font-weight: 800;
    margin-bottom: 20px;
    color: var(--text);
}
.similar-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px 60px;
}
.similar-col a {
    display: block;
    font-size: .9rem;
    color: var(--text);
    padding: 4px 0;
    transition: color .2s;
}
.similar-col a:hover { color: var(--red); }

/* ==================== FOOTER ==================== */
.footer {
    background: var(--footer-bg);
    color: var(--text-muted);
    padding-top: 36px;
    border-top: 1px solid var(--border);
}
.footer-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;
}
.footer-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}
.footer-logo span {
    font-size: 1.2rem;
    font-weight: 800;
    color: var(--text);
}
.footer-desc {
    font-size: .83rem;
    line-height: 1.6;
    color: var(--text-muted);
    max-width: 360px;
}
.footer-right {
    display: flex;
    gap: 24px;
}
.footer-right a {
    font-size: .85rem;
    color: var(--text-light);
    transition: color .2s;
}
.footer-right a:hover { color: var(--text); }
.footer-bottom {
    border-top: 1px solid var(--border);
    margin-top: 28px;
    padding: 16px 0;
    text-align: center;
    font-size: .8rem;
    color: var(--text-muted);
}

/* ==================== HOME PAGE ==================== */
.home-hero {
    padding: 60px 0 50px;
    text-align: center;
    background: linear-gradient(180deg, #f8f9fa 0%, #fff 100%);
}
.home-hero-inner {
    max-width: 580px;
    margin: 0 auto;
}
.home-hero-tag {
    display: inline-block;
    background: #eef2f7;
    color: var(--text-light);
    font-size: .78rem;
    font-weight: 700;
    padding: 5px 14px;
    border-radius: 100px;
    margin-bottom: 20px;
    text-transform: uppercase;
    letter-spacing: .04em;
}
.home-hero h1 {
    font-size: 2.1rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.3;
    margin-bottom: 14px;
}
.home-hero-sub {
    font-size: 1.02rem;
    color: var(--text-light);
    line-height: 1.7;
    margin-bottom: 32px;
}
.home-select-box {
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px 24px;
    text-align: left;
    box-shadow: 0 4px 24px rgba(0,0,0,.06);
}
.home-select-label {
    display: block;
    font-size: .9rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}
.home-select {
    width: 100%;
    margin-bottom: 16px;
}
.home-go {
    width: 100%;
}
.home-go:disabled {
    opacity: .5;
    cursor: not-allowed;
}

/* Features row */
.home-features {
    display: flex;
    justify-content: center;
    gap: 32px;
    margin-top: 40px;
    flex-wrap: wrap;
}
.home-feature {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: .85rem;
    font-weight: 600;
    color: var(--text);
}
.home-feature-icon {
    width: 36px;
    height: 36px;
    background: #f0f3f6;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

/* How it works */
.home-steps {
    padding: 50px 0 60px;
}
.home-steps-title {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    margin-bottom: 36px;
}
.home-steps-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 28px;
    max-width: 800px;
    margin: 0 auto;
}
.home-step {
    text-align: center;
    padding: 24px 16px;
}
.home-step-num {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: var(--text);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    font-weight: 800;
    margin: 0 auto 14px;
}
.home-step h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 8px;
}
.home-step p {
    font-size: .85rem;
    color: var(--text-light);
    line-height: 1.6;
}

@media (max-width: 600px) {
    .home-hero h1 { font-size: 1.5rem; }
    .home-features { gap: 16px; }
    .home-feature { font-size: .78rem; }
    .home-steps-grid { grid-template-columns: 1fr; gap: 12px; }
}

/* ==================== SUCCESS PAGE ==================== */
.success-page { padding: 60px 0 80px; }
.success-card {
    max-width: 520px;
    margin: 0 auto;
    text-align: center;
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 40px 32px;
    background: var(--bg);
}
.success-icon {
    width: 56px; height: 56px;
    border-radius: 50%;
    background: #d5f5e3;
    color: #27ae60;
    display: flex; align-items: center; justify-content: center;
    font-size: 1.6rem; font-weight: 800;
    margin: 0 auto 16px;
}
.success-card h1 { font-size: 1.5rem; font-weight: 800; margin-bottom: 8px; }
.success-sub { font-size: .93rem; color: var(--text-muted); margin-bottom: 28px; }
.success-details {
    text-align: left;
    margin-bottom: 24px;
    border: 1px solid var(--border-light);
    border-radius: 6px;
    overflow: hidden;
}
.success-row {
    display: flex; justify-content: space-between; align-items: center;
    padding: 10px 16px;
    font-size: .88rem;
    border-bottom: 1px solid var(--border-light);
}
.success-row:last-child { border-bottom: none; }
.success-label { color: var(--text-muted); }
.success-value { font-weight: 700; color: var(--text); }
.success-info {
    font-size: .85rem;
    color: var(--text-light);
    margin-bottom: 24px;
    line-height: 1.6;
}

/* ==================== LEGAL PAGES ==================== */
.legal-page { padding: 40px 0 80px; }
.legal-page .container { max-width: 800px; }
.legal-page h1 {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 8px;
    color: var(--text);
}
.legal-updated {
    color: var(--text-muted);
    font-size: .85rem;
    margin-bottom: 36px;
}
.legal-section { margin-bottom: 32px; }
.legal-section h2 {
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 14px;
    text-align: left;
}
.legal-section h3 {
    font-size: 1rem;
    font-weight: 600;
    margin: 16px 0 10px;
    color: var(--text);
}
.legal-section p {
    font-size: .9rem;
    color: var(--text-light);
    line-height: 1.8;
    margin-bottom: 10px;
}
.legal-section ul { list-style: none; margin-bottom: 14px; }
.legal-section ul li {
    font-size: .9rem;
    color: var(--text-light);
    line-height: 1.8;
    padding: 3px 0 3px 18px;
    position: relative;
}
.legal-section ul li::before {
    content: '';
    position: absolute;
    left: 0; top: 13px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: var(--red);
}
.legal-section a { color: var(--red); text-decoration: underline; }
.legal-section a:hover { color: var(--red-dark); }

.legal-table {
    width: 100%;
    border-collapse: collapse;
    margin: 14px 0;
    font-size: .85rem;
}
.legal-table th, .legal-table td {
    text-align: left;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.legal-table th {
    background: var(--bg-light);
    font-weight: 700;
    color: var(--text);
    font-size: .82rem;
    text-transform: uppercase;
    letter-spacing: .03em;
}
.legal-table td { color: var(--text-light); }

/* ==================== RESPONSIVE ==================== */
@media (max-width: 900px) {
    .main-grid { grid-template-columns: 1fr; }
    .preview-column { position: static; }
    .article-grid { grid-template-columns: 1fr; }
    .sidebar { position: static; }
    .similar-grid { grid-template-columns: 1fr; }
    .footer-grid { grid-template-columns: 1fr 1fr; gap: 24px; }
}

@media (max-width: 600px) {
    .nav-links { display: none; }
    .hero-title {
        font-size: 1rem;
        padding: 16px 0;
    }
    .hero-title .container {
        flex-wrap: wrap;
        gap: 4px;
    }
    .operator-logo-img {
        height: 18px;
        max-width: 90px;
    }
    .countdown-bar {
        font-size: .75rem;
        padding: 8px 12px;
        gap: 6px;
        flex-wrap: wrap;
    }
    .countdown-bar strong { white-space: nowrap; }
    .form-row { grid-template-columns: 1fr; }
    .form-card { padding: 20px; }
    .footer-grid { grid-template-columns: 1fr; }
    .article-content h2 { font-size: 1.2rem; }
}
