/* Shared Google + Email authentication modal. */
body.auth-modal-open {
    overflow: hidden;
}

.auth-modal {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
}

.auth-modal.hidden {
    display: none !important;
}

.auth-modal__backdrop {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(135deg, rgba(248, 250, 252, 0.68), rgba(238, 242, 255, 0.58)),
        rgba(15, 23, 42, 0.24);
    backdrop-filter: blur(14px);
}

.auth-modal__panel {
    position: relative;
    width: min(800px, calc(100vw - 32px));
    max-height: calc(100vh - 32px);
    overflow: hidden auto;
    border: 1px solid rgba(203, 213, 225, 0.8);
    border-radius: 26px;
    background: #fff;
    box-shadow: 0 26px 70px rgba(15, 23, 42, 0.2);
}

.auth-modal__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
    padding: 2.35rem 2.75rem 1.2rem;
}

.auth-modal__header h2 {
    margin: 0;
    color: #0f172a;
    font-size: 2rem;
    font-weight: 800;
    line-height: 1.15;
}

.auth-modal__intro {
    min-width: 0;
}

.auth-modal__subtitle {
    margin: 0.75rem 0 0;
    color: #64748b;
    font-size: 1rem;
    line-height: 1.55;
}

.auth-modal__close {
    width: 3.05rem;
    height: 3.05rem;
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    color: #475569;
    background: #fff;
    font-size: 1.1rem;
    transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.auth-modal__close:hover {
    border-color: #cbd5e1;
    color: #0f172a;
    background: #f8fafc;
}

.auth-modal__body {
    padding: 0 2.75rem 2.35rem;
}

.auth-modal__google,
.auth-modal__send,
.auth-modal__verify,
.auth-modal__secondary {
    min-height: 3.25rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.65rem;
    border-radius: 12px;
    font-weight: 800;
    white-space: nowrap;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.auth-modal__google {
    width: 100%;
    min-height: 3.25rem;
    border: 1px solid #cbd5e1;
    color: #0f172a;
    background: #fff;
    font-size: 1rem;
}

.auth-modal__google:hover {
    border-color: #94a3b8;
    background: #f8fafc;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.auth-modal__google-mark {
    width: 1.35rem;
    height: 1.35rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: transparent;
    background: conic-gradient(from -45deg, #4285f4 0 25%, #34a853 0 43%, #fbbc05 0 64%, #ea4335 0 82%, #4285f4 0 100%);
    background-clip: text;
    -webkit-background-clip: text;
    font-size: 1.25rem;
    font-weight: 900;
    line-height: 1;
}

.auth-modal__divider {
    display: flex;
    align-items: center;
    gap: 1.4rem;
    margin: 1.45rem 0;
    color: #64748b;
    font-size: 0.95rem;
}

.auth-modal__divider::before,
.auth-modal__divider::after {
    content: '';
    height: 1px;
    flex: 1;
    background: #cbd5e1;
}

.auth-modal__tabs {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    padding: 0.18rem;
    border: 1px solid #d8dce8;
    border-radius: 14px;
    background: #f8fafc;
}

.auth-modal__tab {
    min-height: 3rem;
    border: 0;
    border-radius: 12px;
    color: #64748b;
    background: transparent;
    font-size: 0.98rem;
    font-weight: 800;
    white-space: nowrap;
    transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.auth-modal__tab.active {
    color: #5b37d8;
    background: #f4f0ff;
    box-shadow: inset 0 0 0 1px rgba(124, 58, 237, 0.26);
}

.auth-modal__tab:focus-visible,
.auth-modal__close:focus-visible,
.auth-modal__google:focus-visible,
.auth-modal__send:focus-visible,
.auth-modal__verify:focus-visible,
.auth-modal__secondary:focus-visible {
    outline: none;
    box-shadow: 0 0 0 4px rgba(124, 58, 237, 0.18);
}

.auth-modal__field {
    display: grid;
    gap: 0.55rem;
    margin-top: 1.35rem;
}

.auth-modal__field label {
    color: #334155;
    font-size: 0.97rem;
    font-weight: 800;
}

.auth-modal__inline {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(11.25rem, 13.75rem);
    gap: 0.8rem;
}

.auth-modal__inline input,
.auth-modal__field > input {
    width: 100%;
    min-width: 0;
    height: 3.25rem;
    padding: 0 1rem;
    border: 1px solid #cbd5e1;
    border-radius: 12px;
    color: #0f172a;
    background: #fff;
    font-size: 1rem;
}

.auth-modal__inline input::placeholder,
.auth-modal__field > input::placeholder {
    color: #64748b;
}

.auth-modal__inline input:focus,
.auth-modal__field > input:focus {
    outline: none;
    border-color: #7c3aed;
    box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.14);
}

.auth-modal__send,
.auth-modal__verify {
    padding: 0 1.15rem;
    border: 0;
    color: #fff;
    background: linear-gradient(135deg, #6d35ef, #2563eb);
    font-size: 0.98rem;
}

.auth-modal__full {
    width: 100%;
    margin-top: 1.05rem;
}

.auth-modal__send:hover,
.auth-modal__verify:hover {
    box-shadow: 0 10px 22px rgba(37, 99, 235, 0.26);
}

.auth-modal__secondary {
    padding: 0 1rem;
    border: 1px solid #cbd5e1;
    color: #334155;
    background: #fff;
}

.auth-modal__secondary:hover {
    background: #f9fafb;
}

.auth-modal__send:disabled,
.auth-modal__verify:disabled,
.auth-modal__secondary:disabled {
    border: 1px solid #d8dee9;
    color: #64748b;
    background: #f8fafc;
    box-shadow: none;
    cursor: not-allowed;
}

.auth-modal__helper,
.auth-modal__hint {
    margin: 0;
    color: #64748b;
    font-size: 0.9rem;
    line-height: 1.45;
}

.auth-modal__actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-top: 1rem;
}

.auth-modal__status {
    min-height: 1.3rem;
    margin: 1rem 0 0;
    color: #475569;
    font-size: 0.88rem;
}

.auth-modal__status.is-success {
    color: #047857;
}

.auth-modal__status.is-error {
    color: #b91c1c;
}

.auth-modal__trust {
    margin: 0.8rem 0 0;
    color: #64748b;
    font-size: 0.88rem;
    line-height: 1.45;
    text-align: center;
}

@media (max-width: 480px) {
    .auth-modal {
        align-items: center;
        padding: 1rem;
    }

    .auth-modal__panel {
        width: calc(100vw - 32px);
        max-height: calc(100vh - 32px);
        border-radius: 22px;
    }

    .auth-modal__header {
        padding: 1.45rem 1.25rem 0.85rem;
    }

    .auth-modal__header h2 {
        font-size: 1.45rem;
    }

    .auth-modal__subtitle {
        font-size: 0.92rem;
    }

    .auth-modal__close {
        width: 2.55rem;
        height: 2.55rem;
        border-radius: 12px;
    }

    .auth-modal__body {
        padding: 0 1.25rem 1.35rem;
    }

    .auth-modal__divider {
        gap: 0.9rem;
        margin: 1.1rem 0;
    }

    .auth-modal__tab {
        min-height: 2.75rem;
        font-size: 0.9rem;
    }

    .auth-modal__inline,
    .auth-modal__actions {
        grid-template-columns: 1fr;
    }

    .auth-modal__send,
    .auth-modal__verify,
    .auth-modal__secondary {
        width: 100%;
    }
}
