/* Auth modal — restored from the planner's earlier account subsystem (git 2103752^); colours from tokens.css. */
/* auth-modal.css - Styling for login/signup modal */

/* Modal Container */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Overlay */
.auth-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    /* background + blur: the shared dialog backdrop (app.css, tokens --backdrop-*) */
}

/* Modal Content */
.auth-modal-content {
    position: relative;
    background: var(--card-bg);
    border-radius: var(--radius-xl);
    box-shadow: var(--shadow-lg);
    max-width: 480px;
    width: calc(100% - 40px);
    max-height: calc(100vh - 40px);
    overflow-y: auto;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(20px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

/* Close Button */
.auth-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--text-muted);
    cursor: pointer;
    padding: 8px;
    line-height: 1;
    transition: color 0.2s, transform 0.2s;
    z-index: 1;
}

.auth-modal-close:hover {
    color: var(--text);
    transform: scale(1.1);
}

/* Modal Header */
.auth-modal-header {
    padding: 40px 40px 24px;
    text-align: center;
}

.auth-modal-header h2 {
    font-family: var(--font-display);
    font-size: 24px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--text);
    margin: 0 0 8px;
}

.auth-modal-header p {
    font-size: 16px;
    color: var(--text-muted);
    margin: 0;
    line-height: 1.5;
}

/* Modal Body */
.auth-modal-body {
    padding: 0 40px 40px;
}

/* Form Containers */
.auth-form-container {
    display: none;
}

.auth-form-container.active {
    display: block;
    animation: fadeInForm 0.3s ease;
}

@keyframes fadeInForm {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Forms */
.auth-modal .auth-form {
    margin-bottom: 20px;
}

.auth-modal .form-group {
    margin-bottom: 16px;
}

.auth-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--text-2);
}

.auth-modal .form-group input {
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--line-card);
    border-radius: var(--radius-control);
    font-size: 15px;
    transition: all 0.2s;
    background: var(--card-bg);
    color: var(--text);
}

.auth-modal .form-group input:hover {
    border-color: var(--hover-border);
}

.auth-modal .form-group input:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: var(--shadow-focus);
}

/* Buttons */
.auth-modal .btn {
    width: 100%;
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    text-decoration: none;
}

.auth-modal .btn-primary {
    background: var(--accent);
    color: white;
}

.auth-modal .btn-primary:hover {
    background: var(--accent-press);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(204, 128, 71, 0.3);
}

.auth-modal .btn-primary:active {
    transform: translateY(0);
}

/* Divider */
.auth-modal .auth-divider {
    position: relative;
    text-align: center;
    margin: 24px 0;
}

.auth-modal .auth-divider::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    width: 100%;
    height: 1px;
    background: var(--line);
}

.auth-modal .auth-divider span {
    position: relative;
    background: white;
    padding: 0 12px;
    color: var(--text-faint);
    font-size: 13px;
    font-weight: 600;
}

/* OAuth Buttons */
.auth-modal .oauth-buttons {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.auth-modal .btn-google {
    background: white;
    color: var(--text);
    border: 2px solid var(--line);
}

.auth-modal .btn-google:hover {
    background: var(--panel-bg);
    border-color: var(--line-strong);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.auth-modal .btn-apple {
    background: #000;
    color: white;
}

.auth-modal .btn-apple:hover {
    background: var(--rail-bg);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}

/* Responsive */
@media (max-width: 640px) {
    .auth-modal-header {
        padding: 32px 24px 20px;
    }

    .auth-modal-header h2 {
        font-size: 24px;
    }

    .auth-modal-header p {
        font-size: 14px;
    }

    .auth-modal-body {
        padding: 0 24px 32px;
    }
}

/* Hide elements for anonymous users */
body:not(.user-logged-in) .require-auth {
    display: none !important;
}

/* ---- Additions for the Scenic account (2026-09) ---------------------------------------------- */

/* Cookie consent */
.consent-banner {
    position: fixed;
    left: 50%;
    bottom: 16px;
    transform: translateX(-50%);
    z-index: 2500;
    max-width: 640px;
    width: calc(100% - 32px);
    background: var(--rail-bg);
    color: var(--line);
    border-radius: 10px;
    padding: 12px 16px;
    display: none;
    align-items: center;
    gap: 14px;
    font-size: 13px;
    line-height: 1.45;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}
.consent-banner.show { display: flex; }
.consent-banner a { color: var(--accent); }
.consent-banner .btn-primary { white-space: nowrap; padding: 8px 14px; }

/* Ribbon items that are not wired yet */
.ribbon-item.ribbon-item--soon { opacity: 0.55; }


/* ---- Combined login / create-account screen (2026-09-27) --------------------------------------- */

/* Steps (account.js showStep): only the active one is visible.
   Rebuilt 2026-10-02 — the original rules were lost with the old profile-menu CSS (this file is untracked). */
.auth-step { display: none; }
.auth-step.active { display: block; }
.auth-step-hint { margin: 0 0 14px; font-size: 14px; line-height: 1.5; color: var(--text-2); }
.form-group .auth-step-hint { margin-bottom: 0; font-size: 12px; color: var(--text-muted); }

/* Text links (Not you? · Forgot your password? · Back · Send a new code) */
.auth-link { color: var(--accent-press); font-size: 13px; font-weight: 500; text-decoration: none; cursor: pointer; }
.auth-link:hover { text-decoration: underline; }
.auth-link-row { display: flex; justify-content: space-between; gap: 12px; margin-top: 12px; }
.auth-link-row .auth-link:only-child { margin: 0 auto; }

/* Live nickname check under the field */
.auth-field-note { min-height: 16px; margin-top: 4px; font-size: 12px; }
.auth-field-note.ok { color: var(--success-press); }
.auth-field-note.bad { color: var(--danger); }

/* 6-digit code (inputs styled by app.css .code-digit) */
.code-input-group { display: flex; justify-content: center; gap: 8px; margin: 4px 0 18px; }
.code-input-group .code-digit { width: 44px; height: 52px; padding: 0; }

/* Provider buttons centred, same width (GSI renders its own 300px button in .gsi-slot) */
.gsi-slot { display: flex; justify-content: center; min-height: 40px; }
.turnstile-slot { display: flex; justify-content: center; }
.turnstile-slot:empty { display: none; }

/* Real checkbox in the modal (app.css .checkbox-label hides the input for its custom .checkbox-text box) */
.auth-modal .checkbox-label { align-items: flex-start; font-weight: 400; font-size: 13px; color: var(--text-2); }
.auth-modal .checkbox-label input[type="checkbox"] {
    position: static; opacity: 1; width: 16px; height: 16px; margin: 1px 0 0; flex: none; accent-color: var(--accent);
}
.auth-modal .checkbox-label a { color: var(--accent-press); }

/* Message above the step: "this address belongs to a Google account", etc. */
.auth-notice {
    background: var(--notice-bg);
    color: var(--notice-text);
    border: 1px solid var(--notice-border);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 14px;
}
/* The address in play on the password / code / nickname steps, with a way back */
.auth-identity {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    background: var(--panel-bg);
    border-radius: 8px;
    padding: 8px 12px;
    margin-bottom: 14px;
    font-size: 13px;
    color: var(--text-2);
}
.auth-identity [data-email] { font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.auth-confirm-text { font-size: 15px; color: var(--text); line-height: 1.5; margin: 0 0 18px; text-align: center; }
.auth-confirm-row { display: flex; flex-direction: column; gap: 10px; }
.auth-modal .btn-secondary {
    width: 100%;
    padding: 12px 20px;
    border-radius: 8px;
    border: 2px solid var(--line);
    background: #fff;
    color: var(--text-2);
    font: inherit;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
}
.auth-modal .btn-secondary:hover { background: var(--panel-bg); }
/* Same pill as the Google button GSI renders (300 × 40) */
.auth-modal .btn-apple {
    width: 300px;
    max-width: 100%;
    margin: 0 auto;
    height: 40px;
    padding: 0 12px;
    border-radius: 999px;
    font-size: 14px;
    font-weight: 500;
    gap: 8px;
}
.auth-modal .btn-apple svg { width: 16px; height: 16px; fill: currentColor; }
