/* ==========================================================================
   Zyra sign-in — full-screen video login (Phase 2.3)
   Loaded by pages/signin.php only. The page is dark in both site themes
   (video background), so colours here are fixed, not theme variables.
   ========================================================================== */

body {
    background: #0a0e13;
}

/* Page chrome that must not float over the full-screen login */
.floating-buttons,
.zyra-mobile-nav {
    display: none !important;
}

.zyra-signin {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    color: #fff;
    background: #0a0e13;
}

/* --- Background video + shade ------------------------------------------- */

.zyra-signin-bg {
    position: fixed;
    inset: 0;
    z-index: 0;
    background: #0a0e13 url(../videos/signin-bg-01-poster.jpg) center / cover no-repeat;
}

.zyra-signin-video {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* Double-buffered rotation: both players stack here; only the active
       one is visible, and the switch is a 700ms crossfade. The poster
       background on .zyra-signin-bg sits behind both, so no gap can flash
       black. FADE_MS in zyra-signin-video.js must match this duration. */
    opacity: 0;
    transition: opacity 700ms ease;
}

.zyra-signin-video.is-active {
    opacity: 1;
}

.zyra-signin-shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg,
        rgba(5, 8, 12, .48) 0%,
        rgba(5, 8, 12, .24) 34%,
        rgba(5, 8, 12, .52) 68%,
        rgba(5, 8, 12, .80) 100%);
}

/* --- Layout -------------------------------------------------------------- */

.zyra-signin-inner {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto;
    padding: max(24px, env(safe-area-inset-top)) 20px calc(14px + env(safe-area-inset-bottom));
}

.zyra-signin-brand {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 36px 0 28px;
}

.zyra-signin-brand-link {
    display: inline-flex;
    color: #fff;
    text-decoration: none;
}

.zyra-signin-logo {
    display: block;
    height: clamp(50px, 9vh, 74px);
    width: auto;
    color: #fff;
    filter: drop-shadow(0 2px 14px rgba(0, 0, 0, .5));
}

.zyra-signin-title {
    margin: 20px 0 0;
    font-size: 20px;
    font-weight: 600;
    line-height: 1.25;
    color: rgba(255, 255, 255, .94);
    text-shadow: 0 1px 10px rgba(0, 0, 0, .45);
}

/* --- Actions: SSO pills, email toggle, form ------------------------------ */

.zyra-signin-actions {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zyra-signin-pill {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    min-height: 56px;
    padding: 14px 20px;
    border: 0;
    border-radius: 999px;
    background: #fff;
    color: #111827;
    font-size: 16px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}

.zyra-signin-pill:hover {
    color: #111827;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, .32);
}

.zyra-signin-pill:active {
    transform: translateY(0);
}

.zyra-signin-pill:focus-visible {
    outline: 3px solid #4d8693;
    outline-offset: 2px;
}

.zyra-signin-pill i {
    font-size: 20px;
    line-height: 1;
}

.zyra-signin-pill--dark {
    background: rgba(18, 24, 32, .72);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .24);
    box-shadow: none;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.zyra-signin-pill--dark:hover {
    color: #fff;
    background: rgba(18, 24, 32, .85);
    box-shadow: none;
}

.zyra-signin-badge {
    position: absolute;
    top: -9px;
    right: 18px;
    padding: 3px 9px;
    border-radius: 999px;
    background: #111827;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .35);
    font-size: 11px;
    font-weight: 600;
    line-height: 1.3;
    white-space: nowrap;
}

.zyra-signin-note {
    text-align: center;
    color: rgba(255, 255, 255, .72);
    font-size: 14px;
}

/* Email form: visible without JS; with JS it starts collapsed and the
   "Continue with email" pill reveals it (PHP adds .is-open after errors). */
.zyra-signin-form {
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}

.zyra-js .zyra-signin-form {
    display: none;
}

.zyra-js .zyra-signin-form.is-open {
    display: flex;
    animation: zyra-signin-reveal .22s ease;
}

html:not(.zyra-js) #zyra-signin-email-toggle {
    display: none;
}

@keyframes zyra-signin-reveal {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

.zyra-signin-field {
    position: relative;
}

.zyra-signin .zyra-signin-input {
    height: 56px;
    border-radius: 999px;
    background: rgba(13, 18, 25, .58);
    border: 1px solid rgba(255, 255, 255, .30);
    color: #fff;
    padding: 0 22px;
    font-size: 16px;
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.zyra-signin .zyra-signin-input::placeholder {
    color: rgba(255, 255, 255, .62);
}

.zyra-signin .zyra-signin-input:focus {
    background: rgba(13, 18, 25, .72);
    border-color: rgba(255, 255, 255, .85);
    color: #fff;
    box-shadow: 0 0 0 3px rgba(77, 134, 147, .55);
}

.zyra-signin .password-toggle-button {
    color: rgba(255, 255, 255, .78);
}

.zyra-signin .password-toggle-button:hover {
    color: #fff;
}

.zyra-signin .invalid-tooltip {
    color: #ffb3b5;
}

.zyra-signin-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    font-size: 14px;
    padding: 0 4px;
}

.zyra-signin .form-check-label {
    color: rgba(255, 255, 255, .90);
}

.zyra-signin-link {
    color: rgba(255, 255, 255, .90);
    text-decoration: none;
    white-space: nowrap;
}

.zyra-signin-link:hover {
    color: #fff;
    text-decoration: underline;
}

.zyra-signin-subnav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    font-size: 14px;
    color: rgba(255, 255, 255, .82);
    padding: 2px 4px 0;
}

.zyra-signin-subnav a {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Alert (same messages as before, glass treatment) -------------------- */

.zyra-signin-alert {
    border-radius: 16px;
    padding: 14px 16px;
    font-size: 14px;
    line-height: 1.45;
    color: #ffd9da;
    background: rgba(229, 72, 77, .18);
    border: 1px solid rgba(229, 72, 77, .55);
    -webkit-backdrop-filter: blur(8px);
    backdrop-filter: blur(8px);
}

.zyra-signin-alert--success {
    color: #c9f2d8;
    background: rgba(51, 179, 107, .18);
    border-color: rgba(51, 179, 107, .55);
}

.zyra-signin-alert--info {
    color: #d7eef3;
    background: rgba(77, 134, 147, .22);
    border-color: rgba(77, 134, 147, .60);
}

/* --- Legal links ---------------------------------------------------------- */

.zyra-signin-legal {
    display: flex;
    justify-content: center;
    gap: 30px;
    padding: 20px 0 4px;
    font-size: 13px;
}

.zyra-signin-legal a {
    color: rgba(255, 255, 255, .74);
    text-decoration: none;
}

.zyra-signin-legal a:hover {
    color: #fff;
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* --- Short / landscape screens ------------------------------------------- */

@media (max-height: 520px) {
    .zyra-signin-brand {
        padding: 14px 0 10px;
    }

    .zyra-signin-logo {
        height: 42px;
    }

    .zyra-signin-title {
        margin-top: 10px;
        font-size: 17px;
    }

    .zyra-signin-pill {
        min-height: 50px;
        padding: 11px 18px;
    }

    .zyra-signin .zyra-signin-input {
        height: 50px;
    }
}

/* --- Reduced motion -------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
    .zyra-signin-pill {
        transition: none;
    }

    .zyra-js .zyra-signin-form.is-open {
        animation: none;
    }
}
