/* ===========================
   Auth Modal – Polished UI
   =========================== */

#auth-overlay {
    position: fixed;
    inset: 0;
    background:
        radial-gradient(circle at top,
            rgba(0, 0, 0, 0.35),
            rgba(0, 0, 0, 0.55));
    backdrop-filter: blur(6px);
    z-index: 1000;

    display: none;
}

#auth-modal {
    position: fixed;
    inset: 0;
    display: grid;
    place-items: center;
    z-index: 1001;
    font-family: system-ui, -apple-system, BlinkMacSystemFont, sans-serif;

    display: none;
}

/* Card */
.auth-card {
    width: 100%;
    max-width: 420px;
    background: linear-gradient(180deg, #ffffff, #fafafa);
    border-radius: 18px;
    padding: 2.25rem 2.25rem 2rem;
    box-shadow:
        0 40px 80px rgba(0, 0, 0, 0.35),
        0 12px 24px rgba(0, 0, 0, 0.18);
    animation: auth-enter 220ms cubic-bezier(.2, .8, .2, 1);
}

/* Entrance motion */
@keyframes auth-enter {
    from {
        transform: translateY(16px) scale(0.96);
        opacity: 0;
    }

    to {
        transform: none;
        opacity: 1;
    }
}

/* Headings */
.auth-card h2 {
    margin: 0 0 0.35rem;
    font-size: 1.5rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.auth-card p {
    margin: 0 0 1.75rem;
    color: #555;
    font-size: 0.95rem;
    line-height: 1.4;
}

/* Inputs */
.auth-card input {
    width: 100%;
    padding: 0.8rem 0.9rem;
    border-radius: 10px;
    border: 1px solid #ddd;
    font-size: 0.95rem;
    transition: border-color 120ms, box-shadow 120ms;
}

.auth-card input+input {
    margin-top: 0.6rem;
}

.auth-card input:focus {
    outline: none;
    border-color: #000;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.08);
}

/* Buttons */
.auth-card button {
    width: 100%;
    padding: 0.85rem 1rem;
    border-radius: 10px;
    border: none;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: transform 120ms, box-shadow 120ms, background 120ms;
}

.auth-card button:active {
    transform: translateY(1px);
}

.auth-card button.primary {
    background: linear-gradient(180deg, #111, #000);
    color: white;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.3);
}

.auth-card button.primary:hover {
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.38);
}

.auth-card button.secondary {
    margin-top: 0.6rem;
    background: #f1f1f1;
    color: #111;
}

.auth-card button.link {
    background: none;
    color: #555;
    margin-top: 1rem;
    font-size: 0.85rem;
}

/* Error box */
.auth-error {
    background: linear-gradient(180deg, #ffeaea, #ffdcdc);
    color: #7a0000;
    border-radius: 10px;
    padding: 0.8rem 1rem;
    margin-bottom: 1.2rem;
    font-size: 0.85rem;
    animation: shake 220ms ease-out;
}

@keyframes shake {
    0% {
        transform: translateX(0);
    }

    25% {
        transform: translateX(-4px);
    }

    50% {
        transform: translateX(4px);
    }

    75% {
        transform: translateX(-3px);
    }

    100% {
        transform: translateX(0);
    }
}

/* View sections */
[data-view] {
    animation: view-fade 160ms ease-out;
}

@keyframes view-fade {
    from {
        opacity: 0;
        transform: translateY(6px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* Verify screen emphasis */
[data-view="verify"] h2 {
    text-align: center;
}

[data-view="verify"] p {
    text-align: center;
    font-size: 0.95rem;
}

[data-view="verify"] button {
    margin-top: 0.75rem;
}


.auth-card {
    position: relative;
}

#close-modal-btn {
    position: absolute;
    top: 14px;
    right: 14px;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #202020;
    border: none;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background 120ms;
}

#close-modal-btn:hover {
    background: #873939;
}