/* --- Authentication Overlay Styles --- */
.auth-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    background-color: rgba(210, 210, 210, 0.7);
    -webkit-backdrop-filter: saturate(180%) blur(20px);
    backdrop-filter: saturate(180%) blur(20px);
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0s linear 0.3s;
    pointer-events: none;
    box-sizing: border-box;
}
.auth-overlay.is-visible {
    opacity: 1;
    visibility: visible;
    transition: opacity 0.3s ease, visibility 0s;
    pointer-events: auto;
}

.auth-modal {
    background-color: rgba(255, 255, 255, 0.8);
    border-radius: 28px;
    padding: 2.5rem;
    width: 100%;
    max-width: 450px;
    position: relative;
    box-shadow: 0 10px 40px rgba(0,0,0,0.1);
    overflow: hidden;
    transition: all 0.3s ease-in-out;
}
#auth-confirmation-message {
    padding:2rem;
}
.auth-close-btn {
    position: fixed;
    top: 2rem;
    right: 2rem;
    width: 35px;
    height: 35px;
    border-radius: 50%;
    background-color: rgba(0, 0, 0, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;transform: scale(1);
    cursor: pointer;
    transition: background-color 0.2s ease;
    z-index: 10000; /* Ensure it's above the overlay */
}
.auth-close-btn svg {
    width: 16px;
    height: 16px;
    fill: #495057;
    transition: fill 0.2s ease;
}

.auth-close-btn:hover {
    transform: scale(1.05);
    background-color: rgba(0, 0, 0, 0.7);
}
.auth-close-btn:hover svg {
    fill: #fcc209;
}

/* --- View Management --- */
.auth-view {
    transition: opacity 0.3s ease-out 0.2s, transform 0.3s ease-out 0.2s;
    opacity: 0;
    transform: translateY(15px);
    display: none; /* Hide by default */
}
.auth-view.is-active {
    display: block;
    opacity: 1;
    transform: translateY(0);
}

/* --- THIS IS THE FIX --- */
.auth-view:not(#auth-initial-view) {
    padding-top: 2rem;
}


/* --- Content Styles --- */
.auth-view-header {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    position: relative;
}
.auth-title {
    text-align: center;
    font-size: 1.25rem;
    max-width: 100%;
    margin: 0;
    padding-bottom:24px;
    transition: all 0.3s ease-out;
}
.auth-options {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.social-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    padding: 0.75rem;
    border-radius: 28px;
    font-size: 1rem;
    font-weight: 500;
    border: 1px solid #ddd;
    background-color: #fff;
    transition: background-color 0.2s ease;
    flex: 1; /* Allow buttons to grow */
}
.social-btn:hover {
    background-color: #f7f7f7;
}
.social-btn img {
    height: 20px;
}

.social-btn-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.separator {
    text-align: center;
    color: #888;
    margin: 0.5rem 0;
}

.line-separator {
    height: 1px;
    background-color: #ddd;
    margin: 1.5rem 0;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}
.auth-input {
    width: 100%;
    padding: 0.85rem;
    border-radius: 28px;
    border: 1px solid #ccc;
    font-size: 1rem;
}
.auth-btn {
    background-color: #ff6f00;
    color: white;
    padding: 0.85rem;
    border-radius: 28px;
    font-size: 1rem;
    font-weight: 600;
    transition: background-color 0.2s ease;
}
.auth-btn:hover {
    background-color: #e66500;
}

.guest-option {
    margin-top: 1.5rem;
    text-align: center;
}
.guest-btn {
    width: 100%;
    background-color: #e8e8ed;
    color: #333;
}
.guest-btn:hover {
    background-color: #ddd;
}

/* --- Back Button Styles --- */
.auth-back-paddle {
    position: absolute;
        top: -2rem;
        left: -1rem;
    transform: translateY(-50%);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.2s ease;
}
.auth-back-paddle:hover {
    background-color: rgba(0,0,0,0.05);
}
.auth-back-paddle svg {
    width: 28px;
    height: 28px;
    fill: #6e6e73;
}


.auth-links {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
}
.auth-links a {
    color: #007aff;
    text-decoration: none;
}

/* --- OTP Input Styles --- */
.otp-container {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    width: 100%;
}
.otp-input {
    width: 100%;
    aspect-ratio: 1 / 1; /* Make it a square */
    height: auto;
    text-align: center;
    font-size: 1.5rem;
    border-radius: 8px;
    border: 1px solid #ccc;
}

/* --- Confirmation Message Spacing --- */
#auth-confirmation-message {
    padding-top: 1rem;
}

/* --- Responsive Styles --- */
@media (max-width: 500px) {
    .auth-overlay {
        align-items: flex-end; /* Dock to the bottom */
        padding: 0;
    }
    .auth-modal {
        width: 100%;
        max-width: 100%;
        border-radius: 28px 28px 0 0; /* Round top corners */
        box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
        max-height: 90vh; /* Prevent it from covering the whole screen */
        overflow-y: auto; /* Allow scrolling within the modal if needed */
        padding: 4rem; /* Reduce padding on smaller screens */
    }
    .auth-title {
        max-width: 100%;
    }
    .auth-back-paddle {
        top: -3.35rem;
        left: -2.6rem;
    }
    .auth-close-btn {
        position: absolute; /* Change to absolute */
        top: 1.5rem;
        right: 1.5rem;
    }

    .social-btn-group {
        flex-direction: row; /* Change to a row */
        justify-content: center;
        gap: 1rem;
    }
    .social-btn {
        height: 60px;
        padding: 0;
    }
    .social-btn-text {
        display: none;
    }
}
