/* ============================================================================
   login.css - the sign-in page (index.php).

   Split layout: the office photo carries the branding on the left, the form
   sits in a solid dark panel on the right. The panel is deliberately opaque -
   a form floating directly on that photo (bright green cabinets, orange
   ceiling) is hard to read and looks amateur.

   The panel palette is the same console dark as css/homepage.css, so signing
   in and landing on the module launcher feel like one continuous screen.

   Photo is images/office_bg.jpg, NOT office2.jpg - office2 has "Samsung Dual
   Camera" burnt into its bottom 110px. See css/mainpage.css.

   Structure the markup must follow:
     .auth
       .auth-brand     logo + company name, on the photo (hidden on mobile)
       .auth-panel     the form card
         .brand-mini   logo + name, shown only on mobile
         .alert        server-side error, if any
         form > .field
   ========================================================================= */

:root {
    --bg: #0b1220;
    --surface: rgba(255, 255, 255, .05);
    --line: rgba(255, 255, 255, .11);
    --line-strong: rgba(255, 255, 255, .22);
    --txt: #eef2f8;
    --txt-dim: #9aa7bd;
    --txt-faint: #6b7896;
    --blue: #4aa8e6;
    --blue-lt: #7cc8f7;
    --gold: #f0b429;
    --danger: #ff8a75;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    margin: 0;
    color: var(--txt);
    background-color: #070b14;
    font-family: "Segoe UI", -apple-system, BlinkMacSystemFont, Roboto, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

/* the office, behind everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -2;
    background-image: url("../images/office_bg.jpg");
    background-position: center center;
    background-repeat: no-repeat;
    background-size: cover;
}

body::after {
    content: "";
    position: fixed;
    inset: 0;
    z-index: -1;
    background:
        radial-gradient(ellipse 700px 520px at 20% 82%, rgba(0, 0, 0, .62), rgba(0, 0, 0, .16) 66%, rgba(0, 0, 0, 0) 100%),
        linear-gradient(0deg, rgba(6, 9, 16, .50) 0%, rgba(6, 9, 16, .22) 46%, rgba(6, 9, 16, .30) 100%);
}

a {
    text-decoration: none;
}

.auth {
    display: flex;
    min-height: 100vh;
}

/* =========================== brand side =========================== */
/* Everything sits in the bottom-left corner rather than centred - it keeps
   the middle of the photo (the desks and the signboard) clear. */
.auth-brand {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 48px 56px 54px;
    min-width: 0;
}

.auth-brand h1 {
    margin: 0;
    font-size: 34px;
    font-weight: 700;
    letter-spacing: -.5px;
    color: #fff;
    text-shadow: 0 3px 16px rgba(0, 0, 0, .85);
    /* 15ch broke this into three lines ending on a stranded "Ltd." */
    max-width: 21ch;
}

.tagline {
    margin: 12px 0 0;
    font-size: 15px;
    font-style: italic;
    color: var(--gold);
    text-shadow: 0 2px 10px rgba(0, 0, 0, .85);
}

.brand-meta {
    margin: 26px 0 0;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, .18);
    max-width: 340px;
    color: rgba(255, 255, 255, .82);
    font-size: 13px;
    line-height: 1.75;
    text-shadow: 0 2px 8px rgba(0, 0, 0, .85);
}

.brand-meta span {
    display: flex;
    align-items: center;
    gap: 9px;
}

.brand-meta svg {
    flex: none;
    color: var(--blue-lt);
}

/* =========================== form panel =========================== */
.auth-panel {
    flex: 0 0 468px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 44px 46px;
    background: linear-gradient(180deg, rgba(13, 20, 36, .97), rgba(8, 12, 22, .98));
    border-left: 1px solid var(--line);
    box-shadow: -30px 0 60px -30px rgba(0, 0, 0, .9);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
}

/* only shows when the brand side is hidden, i.e. on a phone */
.brand-mini {
    display: none;
    align-items: center;
    gap: 12px;
    margin-bottom: 26px;
}

.brand-mini span {
    font-size: 14px;
    font-weight: 700;
    color: #fff;
    line-height: 1.25;
}

.panel-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1.7px;
    color: var(--gold);
}

.panel-eyebrow::before {
    content: "";
    width: 20px;
    height: 2px;
    border-radius: 2px;
    background: var(--gold);
}

.auth-panel h2 {
    margin: 12px 0 6px;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: -.4px;
    color: #fff;
}

.panel-sub {
    margin: 0 0 24px;
    color: var(--txt-dim);
    font-size: 13.5px;
}

/* =========================== alert =========================== */
.alert {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
    padding: 12px 14px;
    border-radius: 11px;
    border: 1px solid rgba(255, 138, 117, .38);
    background: rgba(255, 138, 117, .12);
    color: #ffc9bd;
    font-size: 13px;
    line-height: 1.45;
    animation: shake .4s cubic-bezier(.36, .07, .19, .97);
}

.alert svg {
    flex: none;
    margin-top: 1px;
    color: var(--danger);
}

.alert strong {
    color: #ffd9d0;
}

@keyframes shake {

    10%,
    90% {
        transform: translateX(-2px);
    }

    20%,
    80% {
        transform: translateX(3px);
    }

    30%,
    50%,
    70% {
        transform: translateX(-5px);
    }

    40%,
    60% {
        transform: translateX(5px);
    }
}

/* =========================== fields =========================== */
.field {
    margin-bottom: 16px;
}

.field label {
    display: block;
    margin-bottom: 7px;
    font-size: 11.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: var(--txt-faint);
}

.control {
    position: relative;
}

.control>svg {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--txt-faint);
    pointer-events: none;
    transition: color .18s;
}

.control input {
    width: 100%;
    padding: 13px 14px 13px 44px;
    border-radius: 11px;
    border: 1px solid var(--line);
    background: var(--surface);
    color: var(--txt);
    font-size: 14.5px;
    outline: none;
    transition: border-color .18s, box-shadow .18s, background .18s;
}

.control input::placeholder {
    color: #5c6880;
}

.control input:hover {
    border-color: var(--line-strong);
}

.control input:focus {
    border-color: var(--blue);
    background: rgba(255, 255, 255, .07);
    box-shadow: 0 0 0 3px rgba(74, 168, 230, .22);
}

.control input:focus~svg,
.control input:focus+svg {
    color: var(--blue-lt);
}

/* Chrome paints its own yellow autofill background; this keeps an autofilled
   field looking like the rest of the dark form. */
.control input:-webkit-autofill,
.control input:-webkit-autofill:hover,
.control input:-webkit-autofill:focus {
    -webkit-text-fill-color: var(--txt);
    -webkit-box-shadow: 0 0 0 1000px #131c2e inset;
    caret-color: var(--txt);
}

.pw-toggle {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 9px;
    background: none;
    color: var(--txt-faint);
    cursor: pointer;
    transition: color .18s, background .18s;
}

.pw-toggle:hover {
    color: var(--blue-lt);
    background: rgba(255, 255, 255, .07);
}

.control input[type="password"],
.control input#password {
    padding-right: 48px;
}

/* caps-lock warning, shown by the script */
.capshint {
    display: none;
    align-items: center;
    gap: 6px;
    margin-top: 7px;
    color: var(--gold);
    font-size: 11.5px;
    font-weight: 600;
}

.capshint.on {
    display: flex;
}

/* =========================== row + button =========================== */
.form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin: 4px 0 22px;
}

.remember {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--txt-dim);
    font-size: 12.5px;
    cursor: pointer;
    user-select: none;
}

.remember input {
    width: 15px;
    height: 15px;
    accent-color: var(--blue);
    cursor: pointer;
}

.forgot {
    color: var(--blue-lt);
    font-size: 12.5px;
    font-weight: 600;
}

.forgot:hover {
    color: #a9dcff;
    text-decoration: underline;
}

.btn-login {
    position: relative;
    width: 100%;
    padding: 14px;
    border: 0;
    border-radius: 11px;
    background: linear-gradient(135deg, #4aa8e6, #2b6cb0);
    color: #fff;
    font-size: 14.5px;
    font-weight: 700;
    letter-spacing: .6px;
    cursor: pointer;
    box-shadow: 0 12px 26px -12px rgba(74, 168, 230, .9);
    transition: transform .16s, box-shadow .18s, filter .18s;
}

.btn-login:hover {
    filter: brightness(1.08);
    box-shadow: 0 16px 30px -12px rgba(74, 168, 230, 1);
}

.btn-login:active {
    transform: translateY(1px);
}

.btn-login[disabled] {
    cursor: not-allowed;
    filter: saturate(.5) brightness(.85);
    box-shadow: none;
}

.spinner {
    display: none;
    width: 15px;
    height: 15px;
    margin-right: 9px;
    vertical-align: -2px;
    border: 2px solid rgba(255, 255, 255, .4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.btn-login.is-busy .spinner {
    display: inline-block;
}

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

.panel-foot {
    margin-top: 26px;
    padding-top: 18px;
    border-top: 1px solid var(--line);
    text-align: center;
    font-size: 11.5px;
    color: var(--txt-faint);
}

/* =========================== a11y + motion =========================== */
a:focus-visible,
button:focus-visible,
input:focus-visible {
    outline: 2px solid var(--blue-lt);
    outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
    * {
        transition: none !important;
    }

    .alert,
    .spinner {
        animation: none;
    }
}

/* =========================== responsive =========================== */
@media (max-width: 1000px) {
    .auth-panel {
        flex-basis: 420px;
        padding: 40px 34px;
    }

    .auth-brand {
        padding: 40px;
    }

    .auth-brand h1 {
        font-size: 28px;
    }
}

@media (max-width: 820px) {

    /* the photo stays as the page backdrop, the brand column folds away and
       the form becomes a centred card */
    .auth {
        justify-content: center;
        align-items: center;
        padding: 22px 16px;
    }

    .auth-brand {
        display: none;
    }

    .brand-mini {
        display: flex;
    }

    .auth-panel {
        flex: 0 1 440px;
        width: 100%;
        max-width: 440px;
        padding: 30px 24px;
        border: 1px solid var(--line);
        border-radius: 18px;
        box-shadow: 0 26px 60px -20px rgba(0, 0, 0, .9);
    }

    .auth-panel h2 {
        font-size: 23px;
    }
}
