/* ========================================
   LUMINA FLOW - MODERN AUTH PAGE STYLES
   ======================================== */

/* Ensure landing header is visible on auth pages and doesn't overlap */
body.auth-page main {
    padding-top: calc(var(--header-height) ); /* Added margin top effectively */
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.auth-container {
    flex-grow: 1;
    display: flex;
    align-items: flex-start; /* Start from top to respect the padding */
    justify-content: center;
    padding: var(--spacing-xl) var(--spacing-lg);
    background: radial-gradient(circle at center, var(--bg-alt) 0%, var(--bg-main) 100%);
    position: relative;
}

.auth-card {
    background: var(--color-card);
    border-radius: 28px;
    padding: 3rem;
    width: 100%;
    max-width: 440px; /* Reduced width */
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    border: 1px solid var(--color-border);
    position: relative;
    z-index: 2;
    transition: transform 0.3s ease;
    margin-top: 1rem; /* Extra top margin for breathing room */
}

[data-theme="dark"] .auth-card {
    background: rgba(18, 28, 48, 0.8);
    backdrop-filter: blur(20px);
}

.auth-logo {
    text-align: center;
    margin-bottom: 2.5rem;
}

.auth-logo-img {
    height: 120px; /* Reduced height to fit better with the header */
    width: auto;
    margin-bottom: 1.5rem;
    filter: drop-shadow(0 0 10px rgba(41, 214, 255, 0.2));
}

.auth-logo h1 {
    font-size: 2rem;
    font-weight: 700;
    font-family: var(--font-heading);
    color: var(--color-text-main);
    margin-bottom: 0.5rem;
    letter-spacing: -0.02em;
}

.auth-logo p {
    color: var(--color-text-muted);
    font-size: 1rem;
    font-family: var(--font-body);
}

.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center; /* Center everything including the button */
    width: 100%;
}

.form-group {
    margin-bottom: 1.5rem;
    width: 100%;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    font-family: var(--font-heading);
    color: var(--color-text-main);
    opacity: 0.9;
}

.input-wrapper {
    position: relative;
}

.form-group input {
    width: 100%;
    padding: 1rem 1.25rem;
    border: 2px solid var(--color-border);
    border-radius: 16px;
    font-size: 1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    box-sizing: border-box;
    font-family: var(--font-body);
    color: var(--color-text-main);
    background: var(--bg-sec);
}

.form-group input:focus {
    outline: none;
    border-color: var(--color-primary);
    background: var(--color-card);
    box-shadow: 0 0 0 4px rgba(21, 101, 255, 0.15);
}

.password-group .password-field {
    position: relative;
    display: flex;
    align-items: center;
}

.password-group .password-field input {
    padding-right: 3.5rem;
}

.password-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    width: 24px;
    height: 24px;
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M12 4.5c-7 0-11 7.5-11 7.5s4 7.5 11 7.5 11-7.5 11-7.5-4-7.5-11-7.5zm0 12.5c-2.8 0-5-2.2-5-5s2.2-5 5-5 5 2.2 5 5-2.2 5-5 5zm0-8c-1.7 0-3 1.3-3 3s1.3 3 3 3 3-1.3 3-3-1.3-3-3-3z"/></svg>') center/contain no-repeat;
    background-color: var(--color-text-muted);
    cursor: pointer;
    opacity: 0.6;
    transition: all 0.2s ease;
}

.password-toggle:hover,
.password-toggle.is-visible {
    opacity: 1;
    background-color: var(--color-primary);
}

.password-toggle.is-visible {
    mask: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24"><path fill="currentColor" d="M2.1 3.51 3.51 2.1 21.9 20.49 20.49 21.9l-3.28-3.28C15.77 19.43 13.94 20 12 20c-7 0-11-7.5-11-7.5 1.05-1.97 2.55-3.78 4.36-5.19L2.1 3.51zM7.11 8.52C5.73 9.56 4.57 10.94 3.8 12.08c1.03 1.5 3.76 4.92 8.2 4.92 1.39 0 2.6-.38 3.64-.97l-1.59-1.59c-.63.36-1.35.56-2.05.56-2.21 0-4-1.79-4-4 0-.7.2-1.42.56-2.05l-1.45-1.45zM12 7c-.23 0-.46.02-.68.06l-.25-.25c.3-.05.61-.08.93-.08 7 0 11 7.5 11 7.5-.36.68-.83 1.41-1.43 2.16l-1.43-1.43C21.03 13.64 19.53 12 12 12c-.32 0-.63.03-.93.08l-.25-.25c.22-.04.45-.06.68-.06 2.21 0 4 1.79 4 4 0 .23-.02.46-.06.68l-.25-.25c.04-.22.06-.45.06-.68 0-2.21-1.79-4-4-4z"/></svg>') center/contain no-repeat;
}

.form-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 1rem;
    margin: 1rem 0 2rem;
    width: 100%;
}

.checkbox-label {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.95rem;
    color: var(--color-text-main);
    cursor: pointer;
    font-family: var(--font-body);
    user-select: none;
}

/* Custom Checkbox Styling */
.checkbox-label input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 22px;
    height: 22px;
    border: 2px solid var(--color-border);
    border-radius: 6px;
    background-color: var(--bg-sec);
    cursor: pointer;
    position: relative;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.checkbox-label input[type="checkbox"]:hover {
    border-color: var(--color-primary);
}

.checkbox-label input[type="checkbox"]:checked {
    background-color: var(--color-primary);
    border-color: var(--color-primary);
}

.checkbox-label input[type="checkbox"]:checked::after {
    content: '';
    position: absolute;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
    top: 3px;
}

.forgot-link {
    font-size: 0.875rem;
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 600;
    transition: opacity 0.2s ease;
}

.forgot-link:hover {
    opacity: 0.8;
}

.btn-auth {
    height: 3.5rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: 16px;
    letter-spacing: 0.01em;
    box-shadow: 0 10px 20px rgba(21, 101, 255, 0.2);
}

.btn-auth:hover {
    transform: translateY(-2px);
    box-shadow: 0 15px 30px rgba(21, 101, 255, 0.3);
}

.auth-switch {
    text-align: center;
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--color-border);
    font-size: 0.9375rem;
    color: var(--color-text-muted);
    font-family: var(--font-body);
}

.auth-switch .link {
    color: var(--color-primary);
    text-decoration: none;
    font-weight: 700;
    margin-left: 0.25rem;
    transition: opacity 0.2s ease;
}

.auth-switch .link:hover {
    opacity: 0.8;
}

/* Modals */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    visibility: visible;
    transition: all 0.3s ease;
}

.auth-modal[hidden] {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.auth-modal__backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(7, 17, 31, 0.7);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.auth-modal__card {
    position: relative;
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--color-border);
    border-radius: 28px;
    padding: 2.5rem;
    box-shadow: 0 40px 100px rgba(0, 0, 0, 0.3);
    z-index: 1;
    transform: translateY(0);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.auth-modal[hidden] .auth-modal__card {
    transform: translateY(20px) scale(0.95);
}

.auth-modal__close {
    position: absolute;
    top: 1.5rem;
    right: 1.5rem;
    background: none;
    border: none;
    color: var(--text-sec);
    font-size: 1.5rem;
    cursor: pointer;
    transition: color 0.2s ease;
}

.auth-modal__close:hover {
    color: var(--text-main);
}

.auth-modal__header {
    margin-bottom: 2rem;
    text-align: center;
}

.auth-modal__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-main);
    margin-bottom: 0.5rem;
}

.auth-modal__description {
    color: var(--text-sec);
    font-size: 0.95rem;
}

.auth-modal__form {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.auth-modal__actions {
    margin-top: 1.5rem;
}

.auth-modal__status {
    margin-top: 1rem;
    font-size: 0.875rem;
    text-align: center;
    font-weight: 500;
}

.verification-info {
    padding: 1.5rem;
    background: var(--bg-sec);
    border-radius: 20px;
    border: 1px solid var(--color-border);
    text-align: center;
    margin-bottom: 2rem;
}

.verification-email {
    font-weight: 700;
    color: var(--color-primary);
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    word-break: break-all;
}

.verification-message {
    color: var(--color-text-muted);
    font-size: 0.95rem;
    line-height: 1.5;
}

.verification-actions {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
}

.verification-actions .btn {
    width: 100%;
}

body.auth-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 640px) {
    .auth-card {
        padding: 2rem 1.5rem;
        border-radius: 24px;
    }
    
    .auth-logo-img {
        height: 120px;
    }
}

@media (max-width: 480px) {
    .form-actions {
        flex-direction: column;
        gap: 1rem;
        align-items: flex-start;
    }
}
