/* =============================================================================
   /register — signup page (redesign 2026-09-03)

   Token-driven: every colour is a v4-theme.css variable, which resolves to
   the DESIGN.md ink ramp under the site's single dark theme. No slate /
   indigo literals (the pre-redesign file ran on a leftover Tailwind palette
   that existed nowhere else in the product).

   Layout: value rail (aside.reg-value) + signup card (.register-card) in a
   two-column shell; the rail drops below the card under 960px. The plan
   selector is a vertical row radiogroup (.r-tier), not a card grid — five
   tiers never fit four columns.
   ============================================================================= */

.reg-shell {
    display: grid;
    grid-template-columns: minmax(260px, 340px) minmax(0, 1fr);
    gap: 3rem;
    align-items: start;
    max-width: 1140px;
    /* .main-content + .container already stack 64px of top padding under the
       fixed navbar; keep the shell's own margin small. */
    margin: 0.5rem auto 3rem;
    padding: 0 1.5rem;
}
.reg-shell-narrow {
    grid-template-columns: minmax(0, 560px);
    justify-content: center;
}

/* --- Value rail ----------------------------------------------------------- */
.reg-value {
    position: sticky;
    top: 92px; /* clears the 60px fixed navbar */
}
.reg-value-title {
    font-family: var(--font-display);
    font-size: clamp(1.5rem, 3.2vw, 2.1rem);
    font-weight: 700;
    line-height: 1.1;
    letter-spacing: -0.015em;
    color: var(--text-primary);
    margin: 0 0 0.75rem;
    /* animations.css paints every h1 as green gradient text; DESIGN.md
       reserves the accent for resolved states, so undo it here. */
    background: none;
    -webkit-text-fill-color: var(--text-primary);
}
.reg-value-lead {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.6;
    margin: 0 0 1.5rem;
}
.reg-value-points {
    list-style: none;
    margin: 0;
    padding: 0;
}
.reg-value-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.75rem 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.5;
}
.reg-value-points li + li {
    border-top: 1px solid var(--border-subtle);
}
.reg-value-points li i {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--radius-sm);
    background: var(--accent-dim);
    color: var(--accent-text);
    font-size: 0.82rem;
    margin-top: 1px;
}
.reg-value-reassure {
    margin: 1.25rem 0 0;
    padding-top: 1rem;
    border-top: 1px solid var(--border-subtle);
    color: var(--text-muted);
    font-size: 0.82rem;
    letter-spacing: 0.02em;
}

/* --- Signup card ---------------------------------------------------------- */
.register-card {
    background: var(--bg-card);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-lg);
    padding: 2.5rem;
}
.register-card h2 {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.015em;
    text-align: left;
    margin: 0 0 1.5rem;
}
.reg-section-title {
    font-family: var(--font-display);
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
    margin: 2rem 0 1rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-subtle);
}

/* Server-rendered EN/FR pairs (plan tier copy computed in auth.py from
   plan_enforcer constants). i18n.js sets <html lang>; CSS picks the pair. */
.reg-shell .lang-fr { display: none; }
html[lang="fr"] .reg-shell .lang-fr { display: inline; }
html[lang="fr"] .reg-shell .lang-en { display: none; }

/* --- Google SSO ----------------------------------------------------------- */
.google-signin-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 12px 20px;
    background: #ffffff;         /* Google brand button stays white */
    border: 1px solid #dadce0;
    border-radius: var(--radius-sm);
    color: #3c4043;
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    cursor: pointer;
    transition: box-shadow 0.2s ease, background 0.2s ease;
}
.google-signin-btn:hover {
    background: #f8f9fa;
    box-shadow: var(--shadow-sm);
}
.google-signin-btn:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.oauth-divider {
    display: flex;
    align-items: center;
    text-align: center;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.oauth-divider::before,
.oauth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border-subtle);
}
.oauth-divider span { padding: 0 1rem; }

/* --- Invitation banner ---------------------------------------------------- */
.invitation-banner {
    background: var(--accent-dim);
    border: 1px solid var(--accent-medium);
    border-radius: var(--radius-md);
    padding: 1.25rem;
    margin-bottom: 1.5rem;
    display: flex;
    align-items: center;
    gap: 1rem;
}
.invitation-banner i {
    font-size: 1.5rem;
    color: var(--accent-text);
}
.invitation-banner h3 {
    margin: 0;
    color: var(--text-primary);
    font-size: 1rem;
}
.invitation-banner p {
    margin: 0.25rem 0 0 0;
    color: var(--text-secondary);
    font-size: 0.9rem;
}

/* --- Form fields ----------------------------------------------------------- */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.form-group { margin-bottom: 1.1rem; }

.form-group label {
    display: block;
    color: var(--text-primary);
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.form-group input,
.form-group select {
    width: 100%;
    padding: 0.7rem 0.9rem;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.form-group input::placeholder { color: var(--text-muted); }
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 2px var(--accent-medium);
}
.input-readonly {
    background: var(--bg-secondary) !important;
    cursor: not-allowed;
}

/* Password block */
.password-group { margin-bottom: 1.5rem; }
.password-container {
    display: flex;
    gap: 0.75rem;
    margin-bottom: 0.75rem;
}
.password-input-container { position: relative; flex: 1; }
.password-input-container input { width: 100%; padding-right: 3rem; }

.toggle-password {
    position: absolute;
    right: 0.9rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    transition: color 0.2s ease;
}
.toggle-password:hover { color: var(--text-primary); }

.generate-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0 1.1rem;
    background: var(--accent-dim);
    border: 1px solid var(--accent-medium);
    border-radius: var(--radius-sm);
    color: var(--accent-text);
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: background 0.2s ease;
}
.generate-btn:hover { background: var(--accent-medium); }

/* Strength meter */
.password-strength { margin-top: 0.75rem; }
.strength-meter {
    height: 4px;
    background: var(--border-subtle);
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 0.4rem;
}
.meter-bar { height: 100%; width: 0; transition: background 0.3s ease; }
.strength-text { font-size: 0.82rem; color: var(--text-muted); }

/* Requirements */
.requirements {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 0.5rem 0.75rem;
    margin-top: 0.75rem;
    padding: 0.9rem 1rem;
    background: var(--bg-secondary);
    border-radius: var(--radius-sm);
}
.requirement {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.requirement i { color: var(--text-muted); opacity: 0.5; transition: color 0.2s ease, opacity 0.2s ease; }
.requirement.valid i { color: var(--accent-text); opacity: 1; }
.requirement.valid { color: var(--text-primary); }

.password-match { margin-top: 0.5rem; font-size: 0.82rem; }

.reg-optional-row { margin: 0.25rem 0 0.75rem; }
.reg-optional-row a {
    color: var(--text-secondary);
    font-size: 0.82rem;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
}
.reg-optional-row a:hover { color: var(--text-primary); }
.reg-optional-row i { font-size: 0.7rem; }

/* --- Submit ---------------------------------------------------------------- */
.form-actions { margin-top: 1.5rem; }

.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0.95rem;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    color: #03170d; /* DESIGN.md resolved-ink: white on the accent fails contrast */
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s ease;
}
.btn-submit:not(:disabled):hover { background: var(--accent-bright); }
.btn-submit:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.btn-submit:disabled {
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    color: var(--text-muted);
    cursor: not-allowed;
}

.login-link {
    text-align: center;
    margin-top: 1.5rem;
    color: var(--text-secondary);
    font-size: 0.9rem;
}
.login-link a {
    color: var(--accent-text);
    text-decoration: none;
    font-weight: 600;
}
.login-link a:hover { text-decoration: underline; }

/* CAPTCHA */
.captcha-group {
    display: flex;
    justify-content: center;
    margin: 1.25rem 0;
}

/* =============================================================================
   Plan selector — vertical row radiogroup
   ============================================================================= */
.r-tiers { margin: 0.25rem 0 0.5rem; }

.r-tiers-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-bottom: 0.9rem;
}
.r-tiers-title {
    font-family: var(--font-display);
    margin: 0 0 0.15rem 0;
    color: var(--text-primary);
    font-size: 1.15rem;
    font-weight: 600;
}
.r-tiers-sub {
    margin: 0;
    color: var(--text-muted);
    font-size: 0.82rem;
}

/* Monthly / Annual segmented control */
.r-billing-toggle {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 4px;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
}
.r-billing-toggle button {
    font-family: inherit;
    font-size: 0.78rem;
    font-weight: 600;
    background: transparent;
    color: var(--text-secondary);
    border: none;
    padding: 0.4rem 0.8rem;
    border-radius: var(--radius-sm);
    cursor: pointer;
    transition: background 0.18s ease, color 0.18s ease;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.r-billing-toggle button:hover { color: var(--text-primary); }
.r-billing-toggle button.active {
    background: var(--accent);
    color: #03170d; /* resolved-ink on accent */
}
.r-billing-toggle button:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.r-discount {
    font-size: 0.7rem;
    font-weight: 700;
    background: var(--accent-dim);
    color: var(--accent-text);
    padding: 1px 6px;
    border-radius: var(--radius-sm);
    letter-spacing: 0.02em;
}
.r-billing-toggle button.active .r-discount {
    background: rgba(0, 0, 0, 0.18);
    color: #03170d;
}

/* Rows */
.r-tiers-grid {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.r-tier {
    position: relative;
    display: grid;
    grid-template-columns: 20px minmax(0, 1fr) auto;
    gap: 0.85rem;
    align-items: start;
    background: var(--bg-input);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    cursor: pointer;
    transition: border-color 0.15s ease, background 0.15s ease;
    outline: none;
}
.r-tier:hover { border-color: var(--border-strong); }
.r-tier:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}
.r-tier.is-selected {
    border-color: var(--accent);
    background: var(--accent-dim);
}

.r-tier-radio {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    border-radius: 50%;
    border: 2px solid var(--border-strong);
    background: transparent;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #03170d;
    font-size: 0.7rem;
    transition: background 0.15s ease, border-color 0.15s ease;
}
.r-tier-radio i { opacity: 0; transition: opacity 0.15s ease; }
.r-tier.is-selected .r-tier-radio {
    background: var(--accent);
    border-color: var(--accent);
}
.r-tier.is-selected .r-tier-radio i { opacity: 1; }

.r-tier-main { min-width: 0; }

.r-tier-id {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 0.15rem;
}
.r-tier-name {
    color: var(--text-primary);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: -0.01em;
}
.r-tier-popular-tag {
    background: var(--accent);
    color: #03170d; /* resolved-ink */
    font-size: 0.7rem;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
}
.r-tier-flag.free {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--accent-text);
}
.r-tier-tagline {
    color: var(--text-secondary);
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0 0 0.35rem 0;
}
.r-tier-features {
    list-style: none;
    padding: 0;
    margin: 0;
}
.r-tier-features li {
    display: inline;
    color: var(--text-muted);
    font-size: 0.78rem;
    line-height: 1.6;
}
.r-tier-features li:not(:last-child)::after {
    content: '\00a0\00a0\00b7\00a0'; /* trailing · separator: a wrapped line
                                        never starts with a stray dot */
    color: var(--border-strong);
}

/* Price column */
.r-tier-price {
    text-align: right;
    font-variant-numeric: tabular-nums;
    white-space: nowrap;
    align-self: center;
}
.r-tier-price .r-amount {
    font-family: var(--font-mono);
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}
.r-tier-price .r-period {
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-left: 2px;
    font-weight: 500;
}
.r-tier-price .r-mo-equiv {
    display: block;
    font-size: 0.7rem;
    color: var(--text-muted);
    margin-top: 2px;
    font-weight: 500;
}

/* Annual / monthly price swap, controlled by .cycle-annual on the group */
.r-tier-price .r-price-monthly { display: inline-block; }
.r-tier-price .r-price-annual { display: none; }
.r-tiers-grid.cycle-annual .r-tier-price .r-price-monthly { display: none; }
.r-tiers-grid.cycle-annual .r-tier-price .r-price-annual { display: inline-block; }

/* Footer row: enterprise contact + compare link */
.r-tiers-foot {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 0.75rem;
    margin-top: 0.9rem;
}
.r-tier-enterprise {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    flex: 1;
    min-width: 0;
    text-decoration: none;
    background: transparent;
    border: 1px dashed var(--border-strong);
    border-radius: var(--radius-sm);
    padding: 0.6rem 0.85rem;
    color: var(--text-secondary);
    font-size: 0.82rem;
    transition: border-color 0.18s ease, color 0.18s ease;
}
.r-tier-enterprise:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}
.r-tier-enterprise i { font-size: 1rem; color: var(--accent-text); }
.r-tier-enterprise strong { color: var(--text-primary); }
.r-tier-enterprise-arrow {
    margin-left: auto;
    font-size: 1rem;
    color: var(--text-muted);
}
.r-tier-compare {
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--accent-text);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 0.45rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: background 0.18s ease;
}
.r-tier-compare:hover { background: var(--accent-dim); }
.r-tier-compare:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.r-cc-notice {
    display: none;
    align-items: center;
    gap: 0.6rem;
    margin-top: 0.75rem;
    padding: 0.65rem 0.85rem;
    background: var(--bg-secondary);
    border: 1px solid var(--border-subtle);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-size: 0.78rem;
}
.r-cc-notice i { color: var(--accent-text); }

/* =============================================================================
   Responsive
   ============================================================================= */
@media (max-width: 960px) {
    .reg-shell {
        grid-template-columns: minmax(0, 1fr);
        gap: 2rem;
        margin-top: 1.5rem;
    }
    /* Form first on mobile; the pitch follows for whoever scrolls */
    .reg-value {
        position: static;
        order: 2;
        border-top: 1px solid var(--border-subtle);
        padding-top: 1.5rem;
    }
    .register-card { order: 1; }
}

@media (max-width: 640px) {
    .reg-shell { padding: 0 1rem; }
    .register-card { padding: 1.5rem 1.1rem; }
    .form-grid { grid-template-columns: 1fr; gap: 0; }
    .password-container { flex-direction: column; }
    .generate-btn { padding: 0.6rem 1.1rem; justify-content: center; }
    .r-tiers-head { flex-direction: column; align-items: stretch; }
    .r-billing-toggle { align-self: flex-start; }
    /* Rows: price tucks under the name instead of a right column */
    .r-tier {
        grid-template-columns: 20px minmax(0, 1fr);
        grid-template-areas:
            "radio main"
            ".     price";
    }
    .r-tier-radio { grid-area: radio; }
    .r-tier-main { grid-area: main; }
    .r-tier-price {
        grid-area: price;
        text-align: left;
        margin-top: 0.4rem;
        align-self: start;
    }
    .r-tiers-foot { flex-direction: column; align-items: stretch; }
    .r-tier-compare { justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
    .r-tier, .r-tier-radio, .btn-submit, .meter-bar { transition: none !important; }
}
