/* ==========================================================================
   AUTH.CSS — Password Gate Overlay
   Full-screen authentication overlay matching the dark editorial aesthetic.
   Loaded on every page; hidden once the user is authenticated.
   ========================================================================== */

/* --- Hide all page content until authenticated --- */
body.auth-locked > *:not(.auth-overlay):not(script):not(link) {
    visibility: hidden !important;
    pointer-events: none !important;
}

/* --- Full-screen overlay --- */
.auth-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999999; /* Above everything including navbar (z-index: 999999) */
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--color-dark, #1A1410);
    opacity: 1;
    transition: opacity 0.6s ease, transform 0.6s ease;
}

/* --- Dismissed state (applied by JS after successful auth) --- */
.auth-overlay.auth-dismissed {
    opacity: 0;
    pointer-events: none;
    transform: scale(1.02);
}

/* --- Centered card container --- */
.auth-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 3rem 2.5rem;
    max-width: 420px;
    width: 90%;
    text-align: center;
}

/* --- Monogram (C & M) --- */
.auth-monogram {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: clamp(48px, 8vw, 80px);
    font-weight: 300;
    font-style: italic;
    color: var(--color-light, #F2EDE6);
    letter-spacing: 0.08em;
    line-height: 1.1;
    margin-bottom: 0;
}

/* --- Date --- */
.auth-date {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 14px;
    font-weight: 400;
    color: var(--color-light, #F2EDE6);
    letter-spacing: 0.25em;
    text-transform: uppercase;
    opacity: 0.6;
    margin-bottom: 1.5rem;
}

/* --- Decorative horizontal rule --- */
.auth-rule {
    width: 60px;
    height: 1px;
    background-color: var(--color-light, #F2EDE6);
    opacity: 0.25;
    margin: 0.5rem auto;
}

/* --- Prompt text --- */
.auth-prompt {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: clamp(15px, 1.4vw, 18px);
    font-weight: 300;
    font-style: italic;
    color: var(--color-light, #F2EDE6);
    opacity: 0.7;
    line-height: 1.5;
    margin-bottom: 0.5rem;
}

/* --- Form layout --- */
.auth-form {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    width: 100%;
    margin-top: 0.5rem;
}

/* --- Password input --- */
.auth-input {
    width: 100%;
    max-width: 300px;
    padding: 14px 20px;
    background: transparent;
    border: 1px solid rgba(242, 237, 230, 0.25);
    border-radius: 0;
    color: var(--color-light, #F2EDE6);
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 16px; /* Prevents iOS zoom */
    font-weight: 400;
    letter-spacing: 0.15em;
    text-align: center;
    outline: none;
    transition: border-color 0.3s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-input::placeholder {
    color: var(--color-light, #F2EDE6);
    opacity: 0.35;
    font-style: italic;
    letter-spacing: 0.2em;
}

.auth-input:focus {
    border-color: rgba(242, 237, 230, 0.6);
}

/* --- Submit button --- */
.auth-submit {
    padding: 12px 48px;
    background-color: var(--color-light, #F2EDE6);
    color: var(--color-dark, #1A1410);
    border: none;
    border-radius: 0;
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

.auth-submit:hover {
    background-color: rgba(242, 237, 230, 0.85);
    transform: translateY(-1px);
}

.auth-submit:active {
    transform: translateY(0);
}

.auth-submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none;
}

/* --- Error message --- */
.auth-error {
    font-family: 'Cormorant Garamond', 'Georgia', serif;
    font-size: 14px;
    font-weight: 400;
    font-style: italic;
    color: var(--color-burgundy, #4A1528);
    min-height: 20px;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.auth-error.visible {
    opacity: 1;
    color: #c4697a; /* Lighter burgundy for visibility on dark bg */
}

/* --- Shake animation for wrong password --- */
@keyframes auth-shake {
    0%, 100% { transform: translateX(0); }
    15% { transform: translateX(-8px); }
    30% { transform: translateX(8px); }
    45% { transform: translateX(-6px); }
    60% { transform: translateX(6px); }
    75% { transform: translateX(-3px); }
    90% { transform: translateX(3px); }
}

.auth-input.shake {
    animation: auth-shake 0.5s ease;
    border-color: #c4697a;
}

/* --- Responsive adjustments --- */
@media (max-width: 480px) {
    .auth-card {
        padding: 2rem 1.5rem;
    }

    .auth-input {
        max-width: 100%;
    }
}
