/* =============================================================================
   Sign in (Login/Index)

   Moved out of the view's <style> block. The login page stands on its own - it
   loads no layout and no appearance tokens - so the palette is repeated here from
   executive-dashboard.css, which is what makes the sign in screen read as the same
   product as the portal behind it: royal surfaces, gold accent, Plus Jakarta
   Sans for headings.
   ============================================================================= */

:root {
    --login-bg: #071022;
    --login-panel: #10203c;
    --login-panel-2: #0a1730;
    --login-on-dark: #ffffff;
    --login-on-dark-soft: rgba(255, 255, 255, 0.88);
    --login-on-dark-muted: rgba(255, 255, 255, 0.74);
    --login-gold: #e8b84a;
    --login-gold-soft: rgba(232, 184, 74, 0.15);
    --login-gold-border: rgba(232, 184, 74, 0.32);
    --login-surface: #ffffff;
    --login-field: #fbfcfe;
    --login-text: #14213d;
    --login-muted: #5b657d;
    --login-muted-2: #8b93a7;
    --login-border: rgba(15, 23, 42, 0.13);
    --login-radius: 20px;
    --login-radius-sm: 10px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
    margin: 0;
}

body {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
    font-family: 'Roboto', 'Segoe UI', sans-serif;
    color: var(--login-text);
    /* Two soft washes over the portal's own background keep the card from sitting
       on a flat block of colour */
    background:
        radial-gradient(1100px 620px at 12% -12%, rgba(232, 184, 74, 0.12), transparent 60%),
        radial-gradient(900px 520px at 102% 108%, rgba(74, 163, 255, 0.12), transparent 58%),
        var(--login-bg);
}

/* ---------- The card ---------- */
.login-wrapper {
    display: flex;
    align-items: stretch;
    width: 100%;
    max-width: 980px;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: var(--login-radius);
    overflow: hidden;
    background: linear-gradient(150deg, var(--login-panel) 0%, var(--login-panel-2) 70%);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* ---------- Left: what the portal is ---------- */
.login-left {
    position: relative;
    flex: 1.15 1 0;
    display: flex;
    align-items: center;
    padding: 36px 40px;
    color: var(--login-on-dark);
    /* Royal panel with a faint gold wash for depth, matching the portal default. */
    background:
        radial-gradient(720px 420px at 18% 8%, rgba(232, 184, 74, 0.10), transparent 62%),
        linear-gradient(150deg, var(--login-panel) 0%, var(--login-panel-2) 70%);
    /* Holds the texture behind the copy without it falling behind the card */
    isolation: isolate;
}

/* Texture only: a woven grid drawn in CSS, far too faint to fight the words */
.login-left::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background-image:
        repeating-linear-gradient(45deg, rgba(255, 255, 255, 0.035) 0 1px, transparent 1px 7px),
        repeating-linear-gradient(-45deg, rgba(255, 255, 255, 0.028) 0 1px, transparent 1px 7px),
        repeating-linear-gradient(90deg, rgba(232, 184, 74, 0.05) 0 1px, transparent 1px 64px);
}

/* A gold hairline is the seam between the two panels */
.login-left::after {
    content: "";
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    width: 3px;
    background: linear-gradient(180deg, transparent, var(--login-gold), transparent);
    opacity: 0.6;
}

.login-left__inner {
    position: relative;
    max-width: 470px;
}

.login-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.34rem 0.72rem;
    border: 1px solid var(--login-gold-border);
    border-radius: 999px;
    background: var(--login-gold-soft);
    color: var(--login-gold);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.09em;
    text-transform: uppercase;
}

.login-left h1 {
    margin: 0.8rem 0 0.5rem;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: clamp(1.7rem, 2.4vw, 2.15rem);
    font-weight: 800;
    letter-spacing: -0.015em;
    line-height: 1.15;
}

.login-left p {
    margin: 0;
    max-width: 440px;
    font-size: 1rem;
    line-height: 1.65;
    color: var(--login-on-dark-soft);
}

.login-points {
    display: grid;
    gap: 0.7rem;
    margin: 1.35rem 0 0;
    padding: 0;
    list-style: none;
}

.login-points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
}

.login-points li i {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 31px;
    height: 31px;
    border: 1px solid var(--login-gold-border);
    border-radius: 9px;
    background: var(--login-gold-soft);
    color: var(--login-gold);
    font-size: 0.82rem;
}

.login-points span {
    display: block;
    font-size: 0.84rem;
    line-height: 1.5;
    color: var(--login-on-dark-muted);
}

.login-points strong {
    display: block;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 0.87rem;
    font-weight: 700;
    color: var(--login-on-dark);
}

/* ---------- Right: the form ---------- */
.login-right {
    flex: 0.85 1 0;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-self: center;
    margin: 28px 20px 28px 12px;
    padding: 20px 28px;
    border-radius: 14px;
    background: var(--login-surface);
}

.logo {
    display: block;
    width: auto;
    height: 52px;
    margin: 0 auto 8px;
    object-fit: contain;
}

.formTitle {
    margin: 0 0 10px;
    text-align: center;
    font-size: 0.9rem;
    font-weight: 500;
    color: var(--login-muted);
}

.login-heading {
    margin: 0 0 12px;
    padding-top: 10px;
    border-top: 1px solid var(--login-border);
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 1.02rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: var(--login-text);
}

.formGroup {
    margin-bottom: 10px;
}

.formGroup label {
    display: block;
    margin-bottom: 6px;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 0.67rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--login-muted);
}

/* The icon names the field at a glance and sits inside its box */
.inputWrap {
    position: relative;
    display: flex;
    align-items: center;
}

.inputWrap > i {
    position: absolute;
    left: 13px;
    font-size: 0.85rem;
    color: var(--login-muted-2);
    pointer-events: none;
}

.formGroup input {
    width: 100%;
    height: 42px;
    padding: 0 14px 0 38px;
    border: 1px solid var(--login-border);
    border-radius: var(--login-radius-sm);
    background: var(--login-field);
    color: var(--login-text);
    font-family: inherit;
    font-size: 0.95rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.formGroup input::placeholder {
    color: #98a1b3;
}

.formGroup input:focus {
    outline: none;
    background: #fff;
    border-color: var(--login-gold);
    box-shadow: 0 0 0 4px var(--login-gold-soft);
}

.inputWrap--password input {
    padding-right: 46px;
}

.inputWrap__toggle {
    position: absolute;
    right: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 34px;
    padding: 0;
    border: none;
    border-radius: 8px;
    background: transparent;
    color: var(--login-muted);
    cursor: pointer;
    transition: background 0.2s ease, color 0.2s ease;
}

.inputWrap__toggle:hover {
    background: rgba(15, 23, 42, 0.06);
    color: var(--login-text);
}

.inputWrap__toggle:focus-visible {
    outline: 2px solid var(--login-gold);
    outline-offset: 1px;
}

/* ---------- Sign in ---------- */
/* Gold, as the portal's accent is, on the darkest text it carries */
.submitButton {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 44px;
    margin-top: 6px;
    border: none;
    border-radius: var(--login-radius-sm);
    background: linear-gradient(135deg, #f0c65c, #d9a437);
    color: #17202f;
    font-family: 'Plus Jakarta Sans', 'Segoe UI', sans-serif;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.submitButton__label {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
}

.submitButton:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(217, 164, 55, 0.35);
}

.submitButton:focus-visible {
    outline: 2px solid #17202f;
    outline-offset: 2px;
}

/* While the request is out: the label steps aside for the spinner, and the button
   keeps its colour so it does not read as unavailable. */
.submitButton.is-busy {
    cursor: progress;
    transform: none;
    filter: saturate(0.9);
}

.submitButton.is-busy .submitButton__label {
    visibility: hidden;
}

.submitButton.is-busy::after {
    content: "";
    position: absolute;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(23, 32, 47, 0.3);
    border-top-color: #17202f;
    border-radius: 50%;
    animation: login-spin 0.7s linear infinite;
}

.login-foot {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
    margin: 12px 0 0;
    font-size: 0.72rem;
    color: var(--login-muted);
}

@keyframes login-spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- Narrower screens ---------- */
@media (max-width: 920px) {
    body {
        align-items: flex-start;
        padding: 16px;
    }

    .login-wrapper {
        flex-direction: column;
        border-radius: var(--login-radius);
    }

    .login-left {
        flex: 0 0 auto;
        padding: 28px 24px 20px;
    }

    /* The seam runs along the bottom once the panels stack */
    .login-left::after {
        top: auto;
        left: 0;
        right: 0;
        bottom: 0;
        width: auto;
        height: 3px;
        background: linear-gradient(90deg, transparent, var(--login-gold), transparent);
    }

    .login-right {
        flex: 1 1 auto;
        margin: 0 16px 16px;
        padding: 24px 22px 26px;
    }
}

/* The form comes first on a phone; the selling points are behind it */
@media (max-width: 620px) {
    .login-points {
        display: none;
    }

    .login-left {
        padding: 26px 22px 24px;
    }

    .login-left p {
        font-size: 0.92rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .submitButton,
    .formGroup input,
    .inputWrap__toggle {
        transition: none;
    }

    .submitButton:hover {
        transform: none;
    }

    .submitButton.is-busy::after {
        animation: none;
    }
}
