/* Log ind — the split-panel layout: form on the left, Team-OP branding and the
   globe video on the right. Loaded after auth.css, which supplies the form
   primitives, buttons and alerts.

   The layout, animations and both documented accessibility workarounds are
   unchanged from the inline block this replaces. Controls moved onto the
   base.css tokens; the branded panel deliberately did not (see .visual-side):

     #3D4565  ->  --primary-color on controls, --text-main on headings and
                  labels. NOT on the visual side — see below.
     #003A63  ->  --primary-hover
     #C9DADE  ->  --border-color
     #73AFB6  ->  --primary-color on focus (was 2.46:1, now 10.36:1)
     #8B9BB3  ->  the disabled treatment in auth.css (was 2.82:1, now 8.1:1)
     #F5F7F8  ->  --bg-body                                                  */

/* auth.css centres a single card; this page is a full-bleed two-column split. */
.auth-page {
    display: block;
    padding: 0;
}

.login-wrapper {
    display: flex;
    width: 100%;
    min-height: 100vh;
}

/* ------------------------------------------------------- left: the form */

.login-form-side {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px;
    background: var(--bg-body);
    position: relative;
}

.login-container {
    width: 100%;
    max-width: 450px;
}

.login-header {
    margin-bottom: 40px;
}

.login-header h1 {
    color: var(--text-main);
    font-size: 2rem;
    font-weight: 600;
    margin-bottom: 8px;
    letter-spacing: -0.025em;
}

.login-header p {
    color: var(--text-muted);     /* 10.03:1, was #4d4d4d */
    font-size: 1rem;
    font-weight: 400;
}

.login-button {
    margin-top: 8px;
}

.login-button .spinner {
    display: none;
    width: 16px;
    height: 16px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

.login-button.loading .spinner {
    display: inline-block;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

.login-links {
    text-align: center;
    margin-top: 32px;
    font-size: 0.875rem;
    color: var(--text-muted);
    padding-top: 24px;
    border-top: 1px solid var(--border-color);
}

.login-links a {
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.2s;
}

.login-links a:hover {
    color: var(--primary-hover);
    text-decoration: underline;
}

.login-links .separator {
    color: var(--border-color);
    margin: 0 12px;
}

/* --------------------------------------------------- right: the branding */

/* NOT a token, and must not become one. Globe Dark.mp4 is yuv420p — no alpha —
   so its background is part of the footage: measured #3c4362 at every sampled
   frame. This panel is painted to match it, which is why the video reads as a
   glowing logo rather than a rectangle. Tokenising this to --bg-header (#1f2937)
   for palette consistency is exactly the regression guarded by section 8 of
   scripts/test_auth_pages.py. Changing it means re-encoding the asset first —
   an alpha-channel WebM/HEVC would free the panel, at the cost of a Safari
   fallback. Keep .visual-text below in step with this value. */
.visual-side {
    flex: 1;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 60px;
    overflow: hidden;
    background: #3D4565;
}

.visual-content {
    text-align: center;
    z-index: 3;
    max-width: 800px;
    position: relative;
}

.logo-container {
    margin-bottom: 40px;
    animation: fadeInUp 0.8s ease-out;
    position: relative;
    min-height: 320px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-static {
    width: 100%;
    max-width: 320px;
    height: auto;
    filter: drop-shadow(0 10px 30px rgba(0, 0, 0, 0.2));
    opacity: 1;
    z-index: 2;
    margin-top: 60px;
    transition: opacity 2.2s ease-in-out, transform 2.2s ease-in-out;
}

.logo-static.hidden {
    opacity: 0;
}

.logo-animated {
    width: 600px !important;
    height: auto;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.95);
    filter: drop-shadow(0 5px 15px rgba(61, 69, 101, 0.3));
    opacity: 0;
    z-index: 1;
    background: transparent;
    transition: opacity 2.2s ease-in-out, transform 2.2s ease-in-out;
}

.logo-animated.visible {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.visual-text {
    color: #ffffff;                  /* 9.39:1 on the panel */
    /* Solid bg so axe can resolve contrast deterministically — the decorative
       circles behind are semi-transparent rgba and would otherwise make the
       h2/p contrast "incomplete". Same color as .visual-side, so no visual
       change. Keep these two in step. */
    background-color: #3D4565;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.visual-text h2 {
    font-size: 2.25rem;
    font-weight: 600;
    margin-bottom: 16px;
    line-height: 1.2;
    letter-spacing: -0.025em;
}

.visual-text p {
    font-size: 1.125rem;
    font-weight: 400;
    line-height: 1.6;
}

/* Decorative circles — the brand tints these were authored with, on the panel
   they were authored for. */
.decorative-circle-1 {
    position: absolute;
    width: 500px;
    height: 500px;
    background: rgba(115, 175, 182, 0.15);
    border-radius: 50%;
    top: -250px;
    right: -250px;
    animation: pulse 4s ease-in-out 1;  /* Stops by itself within 5 s: moving content that runs longer must be pausable (WCAG 2.2.2). */
    z-index: 1;
    pointer-events: none;
}

.decorative-circle-2 {
    position: absolute;
    width: 400px;
    height: 400px;
    background: rgba(139, 178, 140, 0.12);
    border-radius: 50%;
    bottom: -200px;
    left: -200px;
    animation: pulse 4s ease-in-out 2s 1;  /* Stops by itself within 5 s: moving content that runs longer must be pausable (WCAG 2.2.2). */
    z-index: 1;
    pointer-events: none;
}

@keyframes fadeInUp {
    from { opacity: 1; transform: translateY(30px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
    0%, 100% { transform: scale(1);   opacity: 1; }
    50%      { transform: scale(1.1); opacity: 0.8; }
}

@media (prefers-reduced-motion: reduce) {
    .logo-container,
    .visual-text,
    .decorative-circle-1,
    .decorative-circle-2,
    .logo-static,
    .logo-animated {
        animation: none;
        transition: none;
    }
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 1024px) {
    .visual-side { padding: 40px; }
    .logo-container { min-height: 280px; }
    .logo-static { max-width: 250px; }
    .logo-animated { max-width: 520px; }
    .visual-text h2 { font-size: 1.75rem; }
    .visual-text p { font-size: 1rem; }
}

@media (max-width: 768px) {
    .login-wrapper { flex-direction: column; }

    .visual-side {
        flex: 0 0 auto;
        min-height: 300px;
        padding: 40px 20px;
    }

    .login-form-side {
        flex: 1;
        padding: 30px 20px;
    }

    .logo-container {
        margin-bottom: 20px;
        min-height: 200px;
    }

    .logo-static { max-width: 180px; }
    .logo-animated { max-width: 380px; }

    .visual-text h2 {
        font-size: 1.5rem;
        margin-bottom: 12px;
    }

    .visual-text p { font-size: 0.875rem; }

    .login-header h1 { font-size: 1.625rem; }
    .login-header p { font-size: 0.875rem; }

    /* Hide decorative circles on mobile — at narrow widths they overlap the
       .visual-text region and axe reports the h2/p as "partially obscured"
       (a contrast false positive). They are purely decorative. */
    .decorative-circle-1,
    .decorative-circle-2 {
        display: none;
    }
}

@media (max-width: 480px) {
    .login-form-side { padding: 20px; }
    .login-container { max-width: 100%; }

    .visual-side {
        min-height: 250px;
        padding: 30px 15px;
    }

    .logo-container { min-height: 160px; }
    .logo-static { max-width: 150px; }
    .logo-animated { max-width: 280px; }

    .visual-text h2 { font-size: 1.25rem; }
    .login-header h1 { font-size: 1.5rem; }
}
