/* Login page styles. Served pre-auth (PUBLIC in middleware.js) and loaded via
   <link> rather than an inline <style> block: the CSP's style-src-elem is
   'self' + Google Fonts only, so an inline block would be refused. */
@import url('https://fonts.googleapis.com/css2?family=Cinzel:wght@400;500;600&family=Cormorant+Garamond:ital,wght@0,300;0,400;1,300;1,400&display=swap');

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { min-height: 100vh; }
body {
    background: radial-gradient(ellipse at 50% 30%, #131d2a 0%, #0b1015 50%, #060809 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ---------- star field ---------- */
.starfield { position: fixed; inset: 0; pointer-events: none; overflow: hidden; }
.starfield span {
    position: absolute;
    border-radius: 50%;
    background: #cbd5e1;
    opacity: 0.4;
    animation: twinkle 3s ease-in-out infinite;
}

/* ---------- content ---------- */
.content { position: relative; z-index: 1; width: 100%; max-width: 28rem; text-align: center; }
h1 {
    font-family: 'Cinzel', 'Palatino Linotype', 'Book Antiqua', Palatino, serif;
    font-size: clamp(2.2rem, 6vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.2em;
    color: #b8cfe0;
    text-shadow: 0 0 30px rgba(123, 164, 204, 0.3), 0 0 60px rgba(123, 164, 204, 0.1);
    margin-bottom: 8px;
}
.welcome {
    font-family: 'Cormorant Garamond', Garamond, 'Palatino Linotype', serif;
    font-size: 0.875rem;
    font-weight: 300;
    letter-spacing: 0.35em;
    text-transform: uppercase;
    color: #6a8fad;
    margin-bottom: 40px;
}
.door-glow { margin-bottom: 32px; animation: ithildinPulse 6s ease-in-out infinite; }
.door-glow svg { width: 100%; max-width: 320px; margin: 0 auto; display: block; }
.inscription {
    font-family: 'Cormorant Garamond', Garamond, 'Palatino Linotype', serif;
    font-size: clamp(1.1rem, 3vw, 1.25rem);
    font-style: italic;
    letter-spacing: 0.15em;
    color: #8fb3cf;
    text-shadow: 0 0 20px rgba(123, 164, 204, 0.2);
    margin-bottom: 8px;
}
.divider {
    width: 96px;
    height: 1px;
    margin: 0 auto 32px;
    opacity: 0.3;
    background: linear-gradient(90deg, transparent, #7ba4cc, transparent);
}

/* ---------- form ---------- */
form { display: flex; flex-direction: column; gap: 14px; align-items: center; }
input[type=email] {
    width: 100%;
    max-width: 320px;
    /* ≥16px keeps iOS Safari from auto-zooming the field on focus */
    font: 400 16px 'Cormorant Garamond', Garamond, serif;
    letter-spacing: 0.08em;
    color: #b8cfe0;
    text-align: center;
    background: linear-gradient(135deg, rgba(123, 164, 204, 0.08) 0%, rgba(123, 164, 204, 0.03) 100%);
    border: 1px solid rgba(123, 164, 204, 0.3);
    border-radius: 8px;
    padding: 13px 20px;
    outline: none;
    transition: border-color 0.4s, box-shadow 0.4s;
}
input[type=email]::placeholder { color: #55738d; }
input[type=email]:focus {
    border-color: rgba(123, 164, 204, 0.55);
    box-shadow: 0 0 25px rgba(123, 164, 204, 0.15);
}
button {
    font-family: 'Cinzel', 'Palatino Linotype', serif;
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    color: #b8cfe0;
    background: linear-gradient(135deg, rgba(123, 164, 204, 0.12) 0%, rgba(123, 164, 204, 0.06) 100%);
    border: 1px solid rgba(123, 164, 204, 0.3);
    border-radius: 8px;
    padding: 14px 32px;
    cursor: pointer;
    transition: background 0.5s, border-color 0.5s, box-shadow 0.5s;
}
button:hover {
    background: linear-gradient(135deg, rgba(123, 164, 204, 0.22) 0%, rgba(123, 164, 204, 0.12) 100%);
    border-color: rgba(123, 164, 204, 0.5);
    box-shadow: 0 0 25px rgba(123, 164, 204, 0.15);
}
button:disabled { opacity: 0.5; cursor: wait; box-shadow: none; }

.note {
    margin: 24px auto 0;
    max-width: 20rem;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    line-height: 1.5;
    color: #6a8fad;
    min-height: 2.6em;
}
.note.ok { color: #8fb3cf; }
.note.err {
    color: #d4908f;
    background: rgba(120, 40, 40, 0.25);
    border: 1px solid rgba(180, 80, 80, 0.35);
    border-radius: 8px;
    padding: 12px 20px;
}
.footer {
    margin-top: 40px;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.75rem;
    letter-spacing: 0.25em;
    text-transform: uppercase;
    color: #6a8fad;
    opacity: 0.3;
}

/* ---------- animations ---------- */
@keyframes twinkle { 0%, 100% { opacity: 0.2; } 50% { opacity: 0.7; } }
@keyframes ithildinPulse {
    0%, 100% { filter: drop-shadow(0 0 4px rgba(123, 164, 204, 0.2)); }
    50% { filter: drop-shadow(0 0 12px rgba(123, 164, 204, 0.4)); }
}
@keyframes starPulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.1); }
}
.star-pulse { animation: starPulse 4s ease-in-out infinite; transform-origin: 200px 80px; }
