/* --------------------------------------------------------- */
/* 💎 PREMIUM GLASS AUTHENTICATION WRAPPER                   */
/* --------------------------------------------------------- */
.auth-wrapper {
    position: relative;
    width: 100%;
    max-width: 400px;
    overflow: hidden;

    /* Apply the glass background and deep blur */
    background: var(--glass-bg);
    backdrop-filter: blur(25px);
    -webkit-backdrop-filter: blur(25px);

    /* Ultra-thin border and iOS-style rounded corners */
    border: 1px solid var(--glass-border);
    border-radius: 28px;
    box-shadow: var(--glass-shadow);
}

.auth-container {
    width: 200%;
    display: flex;
    /* Upgraded to an iOS-style spring animation! */
    transition: transform 0.6s cubic-bezier(0.25, 1, 0.5, 1);
}

.auth-form-block {
    width: 50%;
    padding: 40px 30px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    /* Tightened the gap slightly for a cleaner look */
    text-align: center;
    justify-content: center;
    align-items: center;
}

/* --------------------------------------------------------- */
/* 📝 FROSTED INPUT FIELDS                                   */
/* --------------------------------------------------------- */
.auth-input {
    width: 100%;
    /* Darker inset feel for inputs inside a glass panel */
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    /* Squircle corners */
    padding: 16px;
    color: var(--text-primary);
    font-family: inherit;
    /* Uses your DC font */
    font-size: 1rem;
    outline: none;
    transition: all 0.3s ease;
    margin: 0px 0px 10px 0px;
}

.auth-input::placeholder {
    color: var(--text-muted);
}

/* The Gold Glow on Focus */
.auth-input:focus {
    background: rgba(0, 0, 0, 0.4);
    border-color: var(--accent-color);
    box-shadow: 0 0 0 4px rgba(var(--accent-rgb), 0.15);
}

/* --------------------------------------------------------- */
/* ✨ GOLD GRADIENT BUTTON                                   */
/* --------------------------------------------------------- */
.auth-btn {
    width: 100%;
    background: var(--sent-bg);
    /* Using your new gold gradient! */
    border: none;
    /* Gradients look better without the glass border */

    /* Dark text on the gold gradient provides maximum premium contrast */
    color: #1a1a1c;
    padding: 16px;
    border-radius: 16px;
    font-family: inherit;
    font-size: 1.05rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
    margin-top: 10px;

    /* A soft gold drop shadow */
    box-shadow: 0 4px 15px rgba(var(--accent-rgb), 0.3);

    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.auth-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(var(--accent-rgb), 0.4);
}

.auth-btn:active {
    transform: translateY(1px);
    box-shadow: 0 2px 10px rgba(var(--accent-rgb), 0.2);
}

.auth-btn:disabled {
    background: rgba(255, 255, 255, 0.1);
    /* Muted gray glass */
    color: var(--text-muted);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
    /* Stops the hover jump */
}

.btn-text {
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* The sleek, native-looking spinner */
.btn-spinner {
    position: absolute;
    width: 22px;
    height: 22px;
    /* Dark borders to match your gold button's #1a1a1c text! */
    border: 3px solid rgba(26, 26, 28, 0.15);
    border-top-color: #1a1a1c;
    border-radius: 50%;

    /* Starts hidden and shrunk */
    opacity: 0;
    transform: scale(0.5);
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);

    /* The spin animation (starts paused to save battery) */
    animation: btn-spin 0.8s linear infinite;
    animation-play-state: paused;
}

/* 🚨 THE TRIGGER CLASS (Add this with JS!) */
.auth-btn.is-loading {
    /* Prevent double-clicking while it's loading */
    pointer-events: none;
    /* Optional: Slightly dim the button so it feels "busy" */
    filter: brightness(0.95);
}

.auth-btn.is-loading .btn-text {
    opacity: 0;
    transform: scale(0.8);
}

.auth-btn.is-loading .btn-spinner {
    opacity: 1;
    transform: scale(1);
    animation-play-state: running;
    /* Fire it up! */
}

/* The actual rotation math */
@keyframes btn-spin {
    0% {
        transform: rotate(0deg);
    }

    100% {
        transform: rotate(360deg);
    }
}

/* --------------------------------------------------------- */
/* 🔄 CLEAN TOGGLE LINK                                      */
/* --------------------------------------------------------- */
.toggle-btn {
    background: none;
    border: none;
    color: var(--accent-color);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.95rem;
    text-decoration: none;
    /* Removed the underline for a cleaner look */
    transition: color 0.3s ease;
    margin-top: 5px;
}

/* Optional: Wrap the clickable word (like "Sign Up") in a <span> in your HTML */
.toggle-btn span {
    color: var(--accent-color);
    font-weight: bold;
    transition: text-shadow 0.3s ease;
}

.toggle-btn:hover span {
    text-shadow: 0 0 8px rgba(var(--accent-rgb), 0.5);
}

/* Toggle state classes */
.show-signup .auth-container {
    transform: translateX(-50%);
}

/* --------------------------------------------------------- */
/* 🔒 PASSWORD REQUIREMENT TRACKER                           */
/* --------------------------------------------------------- */
.password-requirements {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 5px;
    /* Pull it slightly closer to the input */
    margin-bottom: 15px;
    padding: 0 10px;
    text-align: left;
}

.req-item {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.85rem;
    color: var(--text-muted);
    /* Starts out greyed out */
    transition: all 0.3s ease;
}

.req-icon {
    width: 14px;
    height: 14px;
    border-radius: 50%;
    border: 2px solid var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.25, 1, 0.5, 1);
}

/* 🟢 THE VALID STATE */
.req-item.valid {
    color: #2ecc71;
    /* Success Green */
}

.req-item.valid .req-icon {
    border-color: #2ecc71;
    background: #2ecc71;
    box-shadow: 0 0 8px rgba(46, 204, 113, 0.4);
}

/* Add a tiny checkmark inside the circle when valid */
.req-item.valid .req-icon::after {
    content: '';
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    margin-top: -2px;
}


/* --------------------------------------------------------- */
/* 📱 NATIVE MOBILE RESPONSIVENESS                           */
/* --------------------------------------------------------- */
@media screen and (max-width: 490px) {
    .auth-wrapper {
        width: 100%;
        /* Use '100dvh' instead of '100%' or '100vh'. 
           This prevents the UI from hiding behind the mobile browser's URL bar! */
        height: 100dvh;
        position: fixed;
        top: 0px;
        left: 0px;
        max-width: none;

        /* Remove the borders and corners so it sits flush like an app */
        border-radius: 0;
        border: none;
    }

    .auth-container {
        height: 100%;
    }

    .auth-form-block {
        /* Add CSS 'env()' to push content down so it doesn't hide behind the iPhone Notch! */
        padding: calc(40px + env(safe-area-inset-top)) 24px calc(20px + env(safe-area-inset-bottom)) 24px;
        gap: 12px;
        /* Slightly tighter gap to save vertical space */
        justify-content: center;
    }

    /* 🚨 Prevent iOS Auto-Zoom */
    .auth-input {
        font-size: 16px;
        /* Must be exactly 16px to stop iPhones from zooming in! */
        padding: 15px 14px;
        /* Slightly slimmer padding for smaller screens */
    }

    .auth-btn {
        font-size: 1rem;
        padding: 15px;
    }

    /* Make the password tracker more legible on small screens */
    .password-requirements {
        margin-bottom: 10px;
    }

    .req-item {
        font-size: 0.9rem;
        /* Bumped up slightly so it's readable when held away */
        gap: 10px;
        /* More breathing room */
    }

    .req-icon {
        width: 16px;
        /* Slightly larger circles for mobile visibility */
        height: 16px;
    }

    .toggle-btn {
        font-size: 1rem;
        padding: 10px;
        /* Give the toggle link a larger touch target for thumbs! */
    }
}