:root {
    color-scheme: light;
    --green: #2f6b45;
    --green-dark: #183d29;
    --green-soft: #e7f1e9;
    --cream: #fbf8f0;
    --ink: #1d2921;
    --muted: #627066;
    --white: #fff;
    --line: #dce5dd;
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

/* Public privacy and account-deletion pages. */
.legal-page { width: min(100% - 32px, 840px); margin: 48px auto; }
.legal-card { background: var(--white); border: 1px solid var(--line); border-radius: 24px; padding: clamp(24px, 5vw, 48px); box-shadow: 0 18px 50px rgba(24, 61, 41, .10); }
.legal-card h1 { margin-top: 0; }
.legal-card h2 { margin-top: 28px; color: var(--green); }
.legal-card p { line-height: 1.7; }
.legal-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }
.legal-note { margin-top: 24px; color: var(--muted); font-size: .92rem; }
.account-delete-card { max-width: 680px; margin: 0 auto; }
.delete-confirmation { display: flex; align-items: flex-start; gap: 10px; line-height: 1.45; }
.delete-confirmation input { width: 20px; height: 20px; flex: 0 0 auto; }
.destructive-button { background: #a12622; border-color: #a12622; }
.destructive-button:hover { background: #811e1b; }

@media (max-width: 600px) {
    .legal-page { width: min(100% - 20px, 840px); margin: 20px auto; }
    .legal-card { border-radius: 18px; padding: 22px 16px; }
    .legal-actions { flex-direction: column; }
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; }
body { margin: 0; background: var(--cream); color: var(--ink); }
a { color: inherit; }

.site-header, main, footer { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.site-header { height: 88px; display: flex; align-items: center; justify-content: space-between; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--green-dark); font-size: 1.18rem; font-weight: 800; text-decoration: none; }
.brand-logo { width: 48px; height: 48px; background: var(--green); border-radius: 14px; }
.status { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .9rem; }
.status span { width: 9px; height: 9px; background: #35a45d; border-radius: 50%; box-shadow: 0 0 0 5px #dff1e5; }

.primary-nav { display: flex; align-items: center; gap: 18px; margin-left: auto; }
.primary-nav a { color: var(--green); font-weight: 700; font-size: .88rem; text-decoration: none; white-space: nowrap; min-height: 44px; display: inline-flex; align-items: center; padding: 6px 4px; }
.primary-nav a:hover, .primary-nav a[aria-current="page"] { color: var(--green-dark); text-decoration: underline; text-underline-offset: 4px; }

/* Legacy nav-link (index.html before nav wrapper was added) */
.nav-link {
    color: var(--green);
    font-weight: 600;
    font-size: .88rem;
    text-decoration: none;
    white-space: nowrap;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    padding: 6px 4px;
}
.nav-link:hover {
    color: var(--green-dark);
    text-decoration: underline;
}

.home-secondary-content { display: none; }
.content-page { width: min(100%, 840px); margin: 42px auto 90px; }
.content-page > .eyebrow { text-align: left; }
.content-page > h1 { font-size: clamp(2.4rem, 5vw, 4.5rem); margin-bottom: 20px; }
.content-page > .lead { margin: 0 0 40px; }

/* Changelog on content-page (versions sub-page) */
.content-page .changelog { margin-bottom: 60px; }

.hero { min-height: 610px; display: grid; grid-template-columns: 1.25fr .75fr; align-items: center; gap: 80px; padding: 72px 0 96px; }
.eyebrow { margin: 0 0 16px; color: var(--green); font-size: .79rem; font-weight: 850; letter-spacing: .14em; text-transform: uppercase; }
h1 { max-width: 760px; margin: 0; color: var(--green-dark); font-family: Georgia, "Times New Roman", serif; font-size: clamp(3rem, 6vw, 5.7rem); line-height: .98; letter-spacing: -.045em; }
.lead { max-width: 660px; margin: 28px 0 0; color: var(--muted); font-size: clamp(1.05rem, 2vw, 1.25rem); line-height: 1.65; }
.actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.button { display: inline-flex; min-height: 50px; align-items: center; justify-content: center; padding: 0 22px; border: 1px solid var(--green); border-radius: 12px; font-weight: 760; text-decoration: none; transition: transform .18s ease, box-shadow .18s ease, background .18s ease; }
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(24, 61, 41, .13); }
.button.primary { background: var(--green); color: var(--white); }
.button.secondary { background: transparent; color: var(--green); }
.download-note { margin-top: 14px; color: var(--muted); font-size: .83rem; }

.app-card { position: relative; padding: 28px; overflow: hidden; background: var(--green-dark); color: var(--white); border-radius: 28px; box-shadow: 0 30px 70px rgba(24, 61, 41, .23); transform: rotate(2deg); }
.app-card::after { content: ""; position: absolute; width: 210px; height: 210px; right: -90px; top: -90px; background: #4caf50; border-radius: 50%; opacity: .2; }
.app-card-top { display: flex; align-items: center; gap: 13px; margin-bottom: 34px; }
.app-card-top div { display: grid; gap: 2px; }
.app-card-top small { color: #bad0c1; }
.mini-logo { width: 44px; height: 44px; border-radius: 13px; flex-shrink: 0; }
.metric { display: flex; align-items: baseline; justify-content: space-between; gap: 20px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,.13); }
.metric span { color: #bad0c1; font-size: .88rem; }
.metric strong { text-align: right; }

.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0 0 100px; }
.features article { padding: 30px; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 20px; }
.feature-icon { display: grid; width: 38px; height: 38px; place-items: center; margin-bottom: 28px; background: var(--green-soft); color: var(--green); border-radius: 50%; font-size: .76rem; font-weight: 850; }
h2 { margin: 0 0 12px; color: var(--green-dark); font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; }
.features p, .install p { margin: 0; color: var(--muted); line-height: 1.65; }

.install { display: flex; align-items: center; justify-content: space-between; gap: 48px; margin-bottom: 90px; padding: 42px 46px; background: var(--green-soft); border-radius: 24px; }
.install div { max-width: 680px; }
.install .eyebrow { margin-bottom: 10px; }
footer { display: flex; justify-content: space-between; gap: 20px; padding: 28px 0 42px; color: var(--muted); border-top: 1px solid var(--line); font-size: .85rem; }
footer > span:first-child { color: var(--green-dark); font-weight: 850; }

.changelog { margin-bottom: 90px; }
.changelog > h2 { margin-bottom: 24px; }
.changelog-list { display: flex; flex-direction: column; gap: 16px; }
.changelog-item { padding: 20px 24px; background: rgba(255,255,255,.58); border: 1px solid var(--line); border-radius: 16px; }
.changelog-version { font-weight: 800; color: var(--green); font-size: 1.05rem; margin-right: 16px; }
.changelog-date { color: var(--muted); font-size: .83rem; }
.changelog-notes { margin: 10px 0 0; padding-left: 20px; color: var(--muted); }
.changelog-notes li { margin-bottom: 4px; line-height: 1.55; }

/* ── Testers section ─────────────────────────────────────── */

.testers {
    margin-bottom: 90px;
}

.testers > h2 {
    margin-bottom: 14px;
}

.testers-desc {
    margin: 0 0 32px;
    color: var(--muted);
    font-size: 1.05rem;
    line-height: 1.65;
    max-width: 700px;
}

.testers-card {
    background: rgba(255, 255, 255, .58);
    border: 1px solid var(--line);
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 48px;
    max-width: 700px;
}

.testers-card h3 {
    color: var(--green-dark);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.2rem;
    margin: 0 0 10px;
}

.testers-card ul {
    margin: 0 0 24px;
    padding-left: 20px;
    color: var(--muted);
    line-height: 1.6;
}

.testers-card li {
    margin-bottom: 6px;
}

.testers-card p {
    margin: 0 0 20px;
    color: var(--muted);
    line-height: 1.65;
}

.testers-card h3:last-of-type + p {
    margin-bottom: 0;
}

.testers-form {
    max-width: 520px;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.testers-form > h2 {
    margin-bottom: 4px;
}

.testers-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.testers-input-group label {
    font-weight: 600;
    color: var(--green-dark);
    font-size: .9rem;
}

.testers-input-group input[type="text"],
.testers-input-group input[type="email"],
.testers-input-group select {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--white);
    transition: border-color .18s ease;
    min-height: 44px;
    appearance: none;
}

.testers-input-group select {
    background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23627066' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 38px;
}

.testers-input-group input:focus,
.testers-input-group select:focus {
    outline: none;
    border-color: var(--green);
}

.testers-checkbox-group {
    flex-direction: row;
    align-items: flex-start;
    gap: 10px;
}

.testers-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    font-weight: 400;
    color: var(--ink);
    font-size: .88rem;
    line-height: 1.5;
    cursor: pointer;
}

.testers-checkbox-label .testers-checkbox {
    margin-top: 3px;
}

.testers-checkbox-label a {
    color: var(--green);
    text-decoration: underline;
}

.testers-checkbox-label a:hover {
    color: var(--green-dark);
}

.required {
    color: var(--green);
    font-weight: 400;
}

.testers-submit {
    padding: 14px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, opacity .18s ease;
    min-height: 44px;
    align-self: flex-start;
}

.testers-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 61, 41, .2);
}

.testers-submit:disabled {
    opacity: .6;
    cursor: not-allowed;
    transform: none;
}

.testers-hint {
    margin: 0;
    color: var(--muted);
    font-size: .85rem;
    line-height: 1.5;
}

.testers .auth-message {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
}

.testers .auth-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}

.testers .auth-message.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.testers-checkbox {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    margin-top: 3px;
    accent-color: var(--green);
    cursor: pointer;
}

.testers-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
    padding: 0;
    margin: -1px;
}

@media (max-width: 820px) {
    .changelog { margin-bottom: 60px; }
    .testers { margin-bottom: 60px; }
    .testers-card { padding: 24px; }
    .testers-form { gap: 16px; }
    .testers-submit { width: 100%; }
}

/* ── Responsive: tablet ─────────────────────────────────── */

@media (max-width: 768px) {
    .site-header, main, footer { width: calc(100% - 24px); }
    .site-header {
        height: auto;
        min-height: auto;
        padding: 10px 0;
        flex-wrap: wrap;
        gap: 4px;
        justify-content: flex-start;
    }
    /* Primera fila: logo a la izquierda, estado a la derecha */
    .brand { font-size: 1rem; gap: 8px; }
    .brand-logo { width: 38px; height: 38px; border-radius: 10px; }
    .status { display: none; }
    .admin-link { font-size: .85rem; }
    /* Segunda fila completa: menú centrado y en ancho completo */
    .primary-nav {
        order: 99;
        width: 100%;
        justify-content: center;
        gap: 10px;
        margin-left: 0;
        padding: 6px 0 2px;
    }
    .primary-nav a {
        white-space: nowrap;
        font-size: .85rem;
        gap: 4px;
    }
    /* El acceso de usuario se conserva: la navegación ya ocupa su propia fila. */
    .user-btn { display: flex; margin-left: auto; }

    .hero { min-height: auto; grid-template-columns: 1fr; gap: 32px; padding: 32px 0 48px; }
    .hero-copy { text-align: center; }
    .eyebrow { text-align: center; }
    .lead { text-align: center; margin: 16px auto 0; }
    .actions { justify-content: center; }
    .download-note { text-align: center; }

    .app-card { transform: rotate(0); padding: 20px; }
    .app-card::after { display: none; }
    .app-card-top { margin-bottom: 20px; }

    .features { grid-template-columns: 1fr; gap: 14px; padding: 0 0 60px; }
    .features article { padding: 22px; }
    h2 { font-size: 1.35rem; }

    .install { flex-direction: column; gap: 20px; padding: 24px 20px; margin-bottom: 50px; text-align: center; }
    .install div { max-width: none; }

    footer { flex-direction: column; gap: 10px; padding: 20px 0 30px; text-align: center; }

    .changelog { margin-bottom: 40px; }
    .changelog-item { padding: 16px; }
    .testers-card { padding: 20px; margin-bottom: 36px; }
    .testers-form { max-width: 100%; }
    .testers-desc { font-size: .98rem; }

}

/* ── Responsive: small tablet / large phone ──────────────── */

@media (max-width: 600px) {
    .site-header, main, footer { width: calc(100% - 16px); }
    .site-header { padding: 8px 0; }
    .brand { font-size: .95rem; gap: 6px; }
    .brand-logo { width: 34px; height: 34px; }
    .status span { display: none; }
    .primary-nav { gap: 6px; padding: 4px 0; }
    .primary-nav a { font-size: .82rem; padding: 8px 6px; min-height: 44px; }
    .content-page { margin-top: 34px; margin-bottom: 50px; }

    .hero { padding: 24px 0 36px; gap: 24px; }
    h1 { font-size: clamp(1.75rem, 7vw, 3rem); }
    .lead { font-size: clamp(.95rem, 3.5vw, 1.1rem); }
    .button { min-height: 44px; padding: 0 16px; font-size: .95rem; }
    .download-note { font-size: .78rem; }

    .app-card { padding: 18px; border-radius: 20px; }
    .metric { padding: 14px 0; font-size: .85rem; }
    .metric span { font-size: .8rem; }
    .metric strong { font-size: .85rem; }

    .features article { padding: 18px; }
    .feature-icon { width: 34px; height: 34px; font-size: .7rem; margin-bottom: 16px; }
    h2 { font-size: 1.25rem; }

    .install { padding: 20px 16px; margin-bottom: 40px; }

    .changelog-item { padding: 14px; }
    .changelog-version { font-size: .95rem; margin-right: 10px; }

    .testers-card { padding: 18px; }
    .testers-card h3 { font-size: 1.1rem; }
    .testers-form { gap: 14px; }
    .testers-input-group input,
    .testers-input-group select { font-size: .95rem; }

}

/* ── Responsive: mobile ──────────────────────────────────── */

@media (max-width: 414px) {
    .site-header { padding: 6px 0; }
    .brand { font-size: .88rem; gap: 5px; }
    .brand-logo { width: 30px; height: 30px; }
    .status { font-size: .72rem; }
    .primary-nav a { font-size: .78rem; padding: 8px 4px; }

    .hero { padding: 18px 0 28px; gap: 20px; }
    h1 { font-size: clamp(1.5rem, 8vw, 2.5rem); line-height: 1.1; }
    .eyebrow { font-size: .72rem; margin-bottom: 10px; }
    .lead { font-size: .9rem; margin: 12px 0 0; }
    .actions { flex-direction: column; align-items: stretch; gap: 10px; }
    .button { width: 100%; justify-content: center; padding: 12px 16px; }

    .app-card { padding: 16px; border-radius: 16px; }
    .app-card-top { margin-bottom: 16px; gap: 10px; }
    .mini-logo { width: 36px; height: 36px; border-radius: 10px; }
    .metric { gap: 10px; padding: 12px 0; }
    .metric span { font-size: .75rem; }
    .metric strong { font-size: .8rem; }

    .features { gap: 12px; padding: 0 0 40px; }
    .features article { padding: 16px; }
    h2 { font-size: 1.15rem; }
    .features article p { font-size: .88rem; }

    .install { padding: 16px 14px; margin-bottom: 30px; }
    .install h2 { font-size: 1.15rem; }

    .changelog-item { padding: 12px; }
    .changelog-version { font-size: .9rem; }
    .changelog-notes li { font-size: .82rem; }

    .testers-card { padding: 16px; margin-bottom: 30px; }
    .testers-form { gap: 12px; }
    .testers-submit { width: 100%; }

}

/* ── Responsive: very small ──────────────────────────────── */

@media (max-width: 360px) {
    .site-header { padding: 4px 0; }
    .brand { font-size: .82rem; gap: 4px; }
    .brand-logo { width: 28px; height: 28px; }
    .status { font-size: .68rem; }
    .primary-nav a { font-size: .74rem; padding: 8px 3px; }

    .hero { padding: 14px 0 22px; gap: 16px; }
    h1 { font-size: clamp(1.35rem, 9vw, 2rem); }
    .eyebrow { font-size: .68rem; }
    .lead { font-size: .85rem; }
    .button { font-size: .88rem; padding: 10px 14px; }
    .download-note { font-size: .72rem; }

    .app-card { padding: 14px; border-radius: 14px; }
    .app-card-top { gap: 8px; margin-bottom: 14px; }
    .mini-logo { width: 32px; height: 32px; }
    .metric { padding: 10px 0; gap: 8px; }
    .metric span { font-size: .7rem; }
    .metric strong { font-size: .75rem; }

    .features { gap: 10px; }
    .features article { padding: 14px; }
    h2 { font-size: 1.08rem; }

    .install { padding: 14px 12px; }

    .changelog-item { padding: 10px; }
    .changelog-version { font-size: .85rem; margin-right: 8px; }

    .testers-card { padding: 14px; }
    .testers-card h3 { font-size: 1rem; }
    .testers-form { gap: 10px; }
    .testers-desc { font-size: .92rem; }

}

/* ── Responsive: tablet landscape / iPad ─────────────────── */

@media (min-width: 769px) and (max-width: 1024px) {
    .site-header, main, footer { width: min(900px, calc(100% - 32px)); }
    .site-header { height: 80px; }
    .hero { grid-template-columns: 1.1fr .9fr; gap: 48px; padding: 48px 0 72px; min-height: 500px; }
    h1 { font-size: clamp(2.2rem, 4vw, 3.8rem); }
    .features { grid-template-columns: repeat(2, 1fr); gap: 16px; padding: 0 0 72px; }
    .install { gap: 36px; padding: 32px 36px; }
    .testers { margin-bottom: 72px; }
    .testers-card { padding: 26px; }
    .primary-nav a { font-size: .85rem; }
}

/* ── Desktop ─────────────────────────────────────────────── */

@media (min-width: 1025px) {
    .site-header, main, footer { width: min(1120px, calc(100% - 40px)); }
}

.user-btn {
    background: none;
    border: 1px solid var(--green);
    border-radius: 50%;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--green);
    transition: transform .18s ease, box-shadow .18s ease;
}
.user-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 61, 41, .15);
}
.user-btn svg {
    stroke: currentColor;
}

/* Auth Popup */
.auth-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.6);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 20px;
}
.auth-popup:not([hidden]) {
    display: flex;
}
.auth-popup-content {
    background: var(--cream);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 400px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-height: 85vh;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.auth-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color .18s ease;
}
.auth-close:hover {
    color: var(--ink);
}
.auth-form {
    display: flex;
    flex-direction: column;
    gap: 16px;
}
.auth-input-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.auth-input-group label {
    font-weight: 600;
    color: var(--green-dark);
    font-size: .9rem;
}
.auth-input-group input {
    padding: 12px 14px;
    border: 1px solid var(--line);
    border-radius: 10px;
    font-size: 1rem;
    background: var(--white);
    transition: border-color .18s ease;
    min-height: 44px;
}
.auth-input-group input:focus {
    outline: none;
    border-color: var(--green);
}
.auth-strength {
    margin-top: -8px;
}
.auth-strength-bar {
    height: 4px;
    background: var(--line);
    border-radius: 2px;
    overflow: hidden;
}
.auth-strength-bar div {
    height: 100%;
    width: 0;
    border-radius: 2px;
    transition: width .2s ease, background .2s ease;
}
.auth-strength-text {
    font-size: .75rem;
    color: var(--muted);
    margin-top: 4px;
    display: block;
}
.auth-submit {
    padding: 14px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-weight: 700;
    font-size: 1rem;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease;
    min-height: 44px;
}
.auth-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(24, 61, 41, .2);
}
.auth-footer {
    text-align: center;
    margin-top: 20px;
    padding-top: 20px;
    border-top: 1px solid var(--line);
    font-size: .9rem;
    color: var(--muted);
}
.auth-switch {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 700;
    cursor: pointer;
    text-decoration: underline;
    margin-left: 6px;
    min-height: 44px;
}
.auth-switch:hover {
    color: var(--green-dark);
}

/* Auth Message */
.auth-message {
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-bottom: 8px;
}
.auth-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.auth-message.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}

/* Password Toggle Button */
.auth-password-group {
    position: relative;
}
.auth-password-group input {
    padding-right: 48px;
}
.auth-toggle-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    border-radius: 4px;
    transition: color 0.18s ease;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.auth-toggle-btn:hover {
    color: var(--ink);
}

/* Password Criteria List */
.auth-criteria-list {
    list-style: none;
    padding: 0;
    margin: 6px 0 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.78rem;
}
.auth-criteria-list li::before {
    content: '\2718';
    margin-right: 6px;
    font-weight: bold;
}
.auth-criteria-list li.met::before {
    content: '\2714';
}

/* Logged-in User Button */
.user-btn.logged-in {
    gap: 8px;
    padding: 4px 12px;
    border-radius: 24px;
}
.user-email {
    font-size: 0.8rem;
    font-weight: 600;
    max-width: 120px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.user-logout-btn {
    background: none;
    border: 1px solid var(--green);
    border-radius: 8px;
    padding: 2px 8px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--green);
    cursor: pointer;
    transition: background 0.18s ease;
}
.user-logout-btn:hover {
    background: var(--green-soft);
}

/* Resend Section */
.auth-resend-section {
    text-align: center;
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--line);
    font-size: 0.9rem;
}
.auth-resend-btn {
    background: none;
    border: none;
    color: var(--green);
    font-weight: 600;
    cursor: pointer;
    text-decoration: underline;
    padding: 0 8px;
    min-height: 44px;
    font-size: 0.9rem;
}
.auth-resend-btn:hover {
    color: var(--green-dark);
}
.auth-resend-btn:disabled {
    color: var(--muted);
    cursor: not-allowed;
    text-decoration: none;
}

.hidden-by-default {
    display: none !important;
}

/* Password strength classes */
.auth-strength .strength-fill {
    transition: width .2s ease, background .2s ease;
}
.strength-0 .auth-strength .strength-fill {
    width: 0%;
    background: var(--line);
}
.strength-1 .auth-strength .strength-fill,
.strength-2 .auth-strength .strength-fill {
    width: 33%;
    background: #ff5252;
}
.strength-3 .auth-strength .strength-fill,
.strength-4 .auth-strength .strength-fill {
    width: 66%;
    background: #ffc107;
}
.strength-5 .auth-strength .strength-fill,
.strength-6 .auth-strength .strength-fill {
    width: 100%;
    background: #4caf50;
}

/* Strength text colors */
.strength-1 .auth-strength-text,
.strength-2 .auth-strength-text {
    color: #ff5252;
}
.strength-3 .auth-strength-text,
.strength-4 .auth-strength-text {
    color: #ffc107;
}
.strength-5 .auth-strength-text,
.strength-6 .auth-strength-text {
    color: #4caf50;
}

/* Criteria list met/unmet colors */
.auth-criteria-list li.met {
    color: #4caf50;
}
.auth-criteria-list li.unmet {
    color: var(--muted);
}

/* Verification page */
.verify-page {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow-x: hidden;
}
.verify-card {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 40px 32px;
    max-width: 440px;
    width: 100%;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0,0,0,0.08);
    overflow-x: hidden;
    word-break: break-word;
}
.verify-card h1 {
    font-family: Georgia, "Times New Roman", serif;
    color: var(--green-dark);
    font-size: 1.8rem;
    margin: 0 0 12px;
}
.verify-card p {
    color: var(--muted);
    line-height: 1.6;
    margin: 0 0 24px;
}
.verify-card .verify-email-display {
    font-weight: 600;
    color: var(--ink);
}
.verify-btn {
    display: inline-block;
    padding: 14px 32px;
    background: var(--green);
    color: var(--white);
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.verify-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(24, 61, 41, 0.2);
}
.verify-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}
.verify-message {
    padding: 12px 16px;
    border-radius: 10px;
    font-size: 0.9rem;
    margin-top: 16px;
}
.verify-message.success {
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #a5d6a7;
}
.verify-message.error {
    background: #fce4ec;
    color: #c62828;
    border: 1px solid #ef9a9a;
}
.verify-back {
    display: inline-block;
    margin-top: 20px;
    color: var(--green);
    text-decoration: underline;
    font-weight: 600;
}

.admin-link {
    color: var(--green-dark);
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
}

.admin-link:hover {
    text-decoration: underline;
}

/* ── Tester promo popup ─────────────────────────────────── */

.tester-promo-popup {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1100;
    padding: 20px;
}
.tester-promo-popup:not([hidden]) {
    display: flex;
}
.tester-promo-content {
    background: var(--cream);
    border: 1px solid var(--line);
    border-radius: 24px;
    padding: 32px 28px;
    max-width: 460px;
    width: 100%;
    position: relative;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}
.tester-promo-close {
    position: absolute;
    top: 12px;
    right: 12px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--muted);
    padding: 4px;
    min-width: 44px;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: color .18s ease;
}
.tester-promo-close:hover {
    color: var(--ink);
}
.tester-promo-title {
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.4rem;
    color: var(--green-dark);
    margin: 0 0 12px;
    padding-right: 36px;
    line-height: 1.25;
}
.tester-promo-text {
    color: var(--muted);
    font-size: .95rem;
    line-height: 1.6;
    margin: 0 0 24px;
}
.tester-promo-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

/* ── Focus visibility (accessibility) ────────────────────── */

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 2px solid var(--green);
    outline-offset: 2px;
}

/* Remove outline for mouse/touch users, keep for keyboard */
*:focus:not(:focus-visible) {
    outline: none;
}

/* Auth overrides stay after base rules so the mobile cascade is effective. */
@media (max-width: 768px) {
    .auth-popup-content { padding: 24px 18px; }
    .user-btn.logged-in { padding: 3px 8px; }
    .user-email { max-width: 80px; font-size: .75rem; }
}

@media (max-width: 600px) {
    .auth-popup { padding: 8px; }
    .auth-popup-content { padding: 20px 16px; border-radius: 18px; }
    .auth-close { top: 6px; right: 6px; }
    .auth-form { gap: 12px; }
    .auth-input-group input { font-size: 16px; padding: 10px 12px; }
    .auth-submit { padding: 12px; font-size: .95rem; }
}

@media (max-width: 414px) {
    .auth-popup-content { padding: 18px 14px; border-radius: 14px; }
    .auth-form { gap: 10px; }
    .auth-input-group label { font-size: .85rem; }
    .auth-footer { font-size: .82rem; margin-top: 16px; padding-top: 16px; }
    .auth-switch { font-size: .85rem; }
    .auth-message { font-size: .82rem; padding: 8px 10px; }
}

@media (max-width: 360px) {
    .auth-popup-content { padding: 16px 12px; }
}

/* ── Tester promo popup responsive ───────────────────────── */

@media (max-width: 768px) {
    .tester-promo-content { padding: 24px 20px; border-radius: 18px; }
    .tester-promo-title { font-size: 1.25rem; }
    .tester-promo-actions { flex-direction: column; }
    .tester-promo-actions .button { width: 100%; justify-content: center; }
}

@media (max-width: 414px) {
    .tester-promo-popup { padding: 16px; }
    .tester-promo-content { padding: 20px 16px; }
    .tester-promo-title { font-size: 1.15rem; }
    .tester-promo-text { font-size: .9rem; }
}

@media (max-width: 360px) {
    .tester-promo-content { padding: 16px 14px; }
    .tester-promo-title { font-size: 1.05rem; }
    .tester-promo-text { font-size: .85rem; }
}

@media (prefers-reduced-motion: reduce) {
    .tester-promo-popup,
    .tester-promo-popup:not([hidden]),
    .tester-promo-close {
        transition: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .button, .button:hover, .user-btn, .user-btn:hover, .verify-btn, .verify-btn:hover,
    .auth-submit, .auth-submit:hover {
        transition: none;
        transform: none;
    }
}
