/* Auth modal for public landing — frosted glass overlay (light landing context) */
.auth-modal-backdrop {
    position: fixed !important;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(15, 23, 42, 0.22);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease;
}

.auth-modal-backdrop.is-open {
    opacity: 1;
    visibility: visible;
}

.auth-modal {
    position: relative;
    width: 100%;
    max-width: 400px;
    max-height: calc(100vh - 32px);
    overflow-y: auto;
    background: rgba(255, 255, 255, 0.88);
    backdrop-filter: blur(24px) saturate(160%);
    -webkit-backdrop-filter: blur(24px) saturate(160%);
    border: 1px solid rgba(255, 255, 255, 0.92);
    border-radius: 20px;
    padding: 32px 28px 28px;
    box-shadow:
        0 24px 64px rgba(15, 23, 42, 0.14),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    transform: translateY(12px) scale(0.98);
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.auth-modal-backdrop.is-open .auth-modal {
    transform: translateY(0) scale(1);
}

.auth-modal-close {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 32px;
    height: 32px;
    border: none;
    border-radius: 8px;
    background: rgba(15, 23, 42, 0.06);
    color: rgba(15, 23, 42, 0.5);
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, color 0.15s;
}

.auth-modal-close:hover {
    background: rgba(15, 23, 42, 0.1);
    color: #0f172a;
}

.auth-modal-header {
    text-align: center;
    margin-bottom: 24px;
}

.auth-modal-title {
    font-family: 'Satisfy', cursive;
    font-size: 28px;
    color: #0f172a;
    margin: 0 0 6px;
    line-height: 1.2;
}

.auth-modal-title .logo-ai {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    color: #0284c7;
    letter-spacing: 0.08em;
}

.auth-modal-subtitle {
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.5);
    margin: 0;
}

.auth-modal-error {
    display: none;
    padding: 10px 14px;
    margin-bottom: 16px;
    border-radius: 10px;
    background: rgba(239, 68, 68, 0.1);
    border: 1px solid rgba(239, 68, 68, 0.25);
    color: #b91c1c;
    font-size: 13px;
    line-height: 1.4;
}

.auth-modal-oauth {
    display: block;
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 16px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: #0f172a;
    font-size: 14px;
    font-weight: 500;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.auth-modal-oauth:hover {
    background: rgba(255, 255, 255, 0.96);
    border-color: rgba(15, 23, 42, 0.18);
}

.auth-modal-oauth-apple {
    background: #0f172a;
    color: #fff;
    border-color: rgba(15, 23, 42, 0.2);
}

.auth-modal-oauth-apple:hover {
    background: #1e293b;
}

.auth-modal-divider {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 16px 0;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(15, 23, 42, 0.4);
}

.auth-modal-divider::before,
.auth-modal-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: rgba(15, 23, 42, 0.12);
}

.auth-modal input[type="email"],
.auth-modal input[type="password"],
.auth-modal input[type="text"] {
    width: 100%;
    padding: 13px 16px;
    margin-bottom: 12px;
    border-radius: 12px;
    border: 1px solid rgba(15, 23, 42, 0.12);
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 14px;
    outline: none;
    transition: border-color 0.15s, box-shadow 0.15s;
    box-sizing: border-box;
}

.auth-modal input::placeholder {
    color: rgba(15, 23, 42, 0.38);
}

.auth-modal input:focus {
    border-color: rgba(2, 132, 199, 0.55);
    box-shadow: 0 0 0 3px rgba(2, 132, 199, 0.12);
}

.auth-modal input:-webkit-autofill,
.auth-modal input:-webkit-autofill:hover,
.auth-modal input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0 1000px rgba(255, 255, 255, 0.96) inset;
    -webkit-text-fill-color: #0f172a;
    caret-color: #0f172a;
    border-color: rgba(15, 23, 42, 0.12);
    transition: background-color 5000s ease-in-out 0s;
}

.auth-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 4px;
}

.auth-modal-btn {
    padding: 13px 16px;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    border: none;
    transition: opacity 0.15s, transform 0.1s;
}

.auth-modal-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.auth-modal-btn-primary {
    background: #0f172a;
    color: #fff;
}

.auth-modal-btn-primary:hover:not(:disabled) {
    background: #1e293b;
}

.auth-modal-btn-secondary {
    background: transparent;
    color: #0f172a;
    border: 1px solid rgba(15, 23, 42, 0.2);
}

.auth-modal-btn-secondary:hover:not(:disabled) {
    background: rgba(255, 255, 255, 0.92);
}

.auth-modal-token {
    margin-top: 16px;
}

.auth-modal-token summary {
    font-size: 12px;
    color: rgba(15, 23, 42, 0.45);
    cursor: pointer;
    list-style: none;
    text-align: center;
}

.auth-modal-token summary::-webkit-details-marker {
    display: none;
}

.auth-modal-token summary:hover {
    color: rgba(15, 23, 42, 0.65);
}

.auth-modal-terms {
    margin-top: 18px;
    font-size: 11px;
    color: rgba(15, 23, 42, 0.45);
    text-align: center;
    line-height: 1.5;
}

.auth-modal-terms a {
    color: #0284c7;
    text-decoration: none;
}

.auth-modal-terms a:hover {
    text-decoration: underline;
}

@media (max-width: 420px) {
    .auth-modal {
        padding: 28px 20px 24px;
    }
    .auth-modal-actions {
        grid-template-columns: 1fr;
    }
}
