/* =============================================================================
   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-gold: #e8b84a;
    --login-gold-soft: rgba(232, 184, 74, 0.15);
    --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;
    width: 100%;
    max-width: 440px;
    border-radius: var(--login-radius);
    background: var(--login-surface);
    box-shadow: 0 30px 70px rgba(0, 0, 0, 0.45);
}

/* ---------- The form ---------- */
.login-right {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    width: 100%;
    padding: 28px 32px 26px;
    border-radius: var(--login-radius);
    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: 620px) {
    body {
        align-items: flex-start;
        padding: 16px;
    }

    .login-right {
        padding: 24px 22px 26px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .submitButton,
    .formGroup input,
    .inputWrap__toggle {
        transition: none;
    }

    .submitButton:hover {
        transform: none;
    }

    .submitButton.is-busy::after {
        animation: none;
    }
}
