/* ============================================================
   OSHOrbit - Authentication ("Executive Minimal", owner choice 2026-11-19)
   Loaded only by templates/base_auth.html, so all styling here is scoped to the sign-in surfaces: staff login,
   Client & External Stakeholder Portal, password reset, activation and sign-out. One shared design; only the
   badge and wording differ per page.
   Layout: white top bar with the OSHOrbit logo | light centre with the form | black Maxborne band at the bottom.
   ============================================================ */

:root {
    --auth-ink: #0b1630;
    --auth-ink-muted: #5b6678;
    --auth-ink-faint: #8a94a6;
    --auth-line: #dfe5ee;
    --auth-field: #f8fafc;
    --auth-field-border: #cfd7e3;
    --auth-primary: #1462e8;
    --auth-orange: #f47a1f;
    --auth-band: #0b0b0d;
    --auth-danger: #b42318;
    --auth-transition-fast: 160ms ease;
    --auth-font-sans: var(--osh-font-body, "Manrope", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
    color: var(--auth-ink);
    background: #ffffff;
    font-family: var(--auth-font-sans);
    -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; }
a { color: inherit; }

/* ---------- Page frame (base_auth.html) ---------- */
.auth-page {
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
}

.auth-top {
    height: 84px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 0 32px;
    background: #ffffff;
    border-bottom: 1px solid var(--auth-line);
}

.auth-top__logo { display: block; height: 54px; width: auto; }
.auth-top__help { font-size: 0.82rem; color: var(--auth-ink-muted); text-align: right; }

.auth-main {
    flex: 1;
    display: flex;
    background: linear-gradient(180deg, #ffffff 0%, #f5f7fb 100%);
}

.auth-maxborne {
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 10px 20px;
    padding: 14px 32px;
    background: var(--auth-band);
    color: #c9c9cf;
    font-size: 0.8rem;
    /* 2026-11-19 (owner): on a short window (laptop screen) the band stays in view at the bottom edge. */
    position: sticky;
    bottom: 0;
    z-index: 5;
}

.auth-maxborne__by { display: inline-flex; align-items: center; gap: 12px; }
.auth-maxborne__logo { display: block; height: 30px; width: auto; }
.auth-maxborne a {
    color: #ffffff;
    font-weight: 800;
    text-decoration: none;
    border-bottom: 2px solid var(--auth-orange);
}
.auth-maxborne a:hover,
.auth-maxborne a:focus-visible { color: var(--auth-orange); outline: none; }

/* ---------- Centre area + form column ---------- */
.auth-aurora {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 44px 22px;
}

.auth-aurora__grid { display: none; }

.auth-login-card {
    width: 100%;
    max-width: 420px;
    color: var(--auth-ink);
}

.auth-login-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
}

/* The logo now lives in the top bar. */

.auth-login-badge {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 12px;
    border-radius: 999px;
    background: #fff4ec;
    border: 1px solid #ffd7bb;
    color: #c2560f;
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
}

.auth-login-badge::before {
    content: "";
    width: 12px;
    height: 12px;
    flex-shrink: 0;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='13' height='13' viewBox='0 0 24 24' fill='none' stroke='%23c2560f' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='11' width='18' height='11' rx='2'/%3E%3Cpath d='M7 11V7a5 5 0 0 1 10 0v4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: contain;
}

.auth-login-title {
    margin: 0;
    font-size: clamp(1.7rem, 2.2vw, 1.95rem);
    font-weight: 800;
    letter-spacing: -0.02em;
    line-height: 1.2;
    color: var(--auth-ink);
}

.auth-login-subtitle {
    margin: 7px 0 0;
    max-width: 30rem;
    font-size: 0.92rem;
    line-height: 1.6;
    color: var(--auth-ink-muted);
}

/* ---------- Form ---------- */
.auth-form {
    display: grid;
    gap: 18px;
    margin-top: 26px;
}

.crm-field,
.form-group {
    display: grid;
    gap: 7px;
    min-width: 0;
}

.auth-form .crm-field label,
.crm-field label {
    margin: 0;
    font-size: 0.82rem;
    font-weight: 700;
    line-height: 1.35;
    color: var(--auth-ink);
}

.auth-form .form-control,
.auth-form input[type="text"],
.auth-form input[type="email"],
.auth-form input[type="password"],
.auth-form input:not([type="checkbox"]):not([type="radio"]) {
    width: 100%;
    min-height: 50px;
    padding: 0 48px 0 44px;
    border-radius: 6px;
    border: 1px solid var(--auth-field-border);
    background-color: var(--auth-field);
    color: var(--auth-ink);
    font: inherit;
    font-size: 0.95rem;
    transition: border-color var(--auth-transition-fast), box-shadow var(--auth-transition-fast), background-color var(--auth-transition-fast);
}

.auth-form .form-control::placeholder,
.auth-form input::placeholder { color: var(--auth-ink-faint); }

.auth-form .form-control:hover,
.auth-form input:not([type="checkbox"]):not([type="radio"]):hover { border-color: #aab6c8; }

.auth-form .form-control:focus,
.auth-form input:not([type="checkbox"]):not([type="radio"]):focus {
    outline: none;
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(20, 98, 232, 0.16);
    background-color: #ffffff;
}

/* Field icons - username (1st) + password (2nd) */
.auth-login-card .auth-form .crm-field:nth-of-type(1) .form-control,
.auth-login-card .auth-form .crm-field:nth-of-type(1) input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 21a8 8 0 0 0-16 0'/%3E%3Ccircle cx='12' cy='7' r='4'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 18px 18px;
}

.auth-login-card .auth-form .crm-field:nth-of-type(2) .form-control,
.auth-login-card .auth-form .crm-field:nth-of-type(2) input {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%238a94a6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='5' y='11' width='14' height='10' rx='2'/%3E%3Cpath d='M8 11V8a4 4 0 0 1 8 0v3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: left 14px center;
    background-size: 18px 18px;
}

/* Password show/hide toggle */
.auth-password-input-wrap { position: relative; }

.auth-password-input-wrap .form-control,
.auth-password-input-wrap input[name="password"] { padding-right: 48px; }

.password-toggle {
    position: absolute;
    top: 50%;
    right: 10px;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 6px;
    background: transparent;
    cursor: pointer;
    z-index: 2;
    transition: background-color var(--auth-transition-fast);
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%235b6678' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M1 12s4-7 11-7 11 7 11 7-4 7-11 7S1 12 1 12z'/%3E%3Ccircle cx='12' cy='12' r='3'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 18px 18px;
}

.password-toggle:hover { background-color: #eef2f7; }

.password-toggle:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(20, 98, 232, 0.3);
}

.password-toggle.is-visible {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='21' height='21' viewBox='0 0 24 24' fill='none' stroke='%235b6678' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 3l18 18'/%3E%3Cpath d='M10.6 5.1A10.7 10.7 0 0 1 12 5c6.2 0 10 7 10 7a18.7 18.7 0 0 1-3.2 4.2'/%3E%3Cpath d='M6.7 6.8C4 8.7 2 12 2 12s3.8 7 10 7c1.8 0 3.3-.4 4.8-1.1'/%3E%3Cpath d='M9.9 9.9A3 3 0 0 0 14.1 14.1'/%3E%3C/svg%3E");
}

.auth-password-input-wrap input[type="password"]::-ms-reveal,
.auth-password-input-wrap input[type="password"]::-ms-clear { display: none; }

/* Errors */
.field-error,
.errorlist,
.form-group ul.errorlist {
    margin: 2px 0 0;
    padding: 0;
    list-style: none;
    font-size: 0.82rem;
    line-height: 1.45;
    color: var(--auth-danger);
}

.form-error-summary {
    margin: 0 0 2px;
    padding: 12px 14px;
    border: 1px solid #f4c7c3;
    border-left: 4px solid var(--auth-danger);
    border-radius: 6px;
    background: #fef3f2;
    color: #7a271a;
}

.form-error-summary h3 {
    margin: 0 0 4px;
    font-size: 0.86rem;
    font-weight: 800;
    color: var(--auth-danger);
}

.form-error-summary p,
.form-error-summary li { margin: 0; font-size: 0.83rem; line-height: 1.5; }

.form-error-summary ul { margin: 4px 0 0; padding-left: 18px; }

/* Submit */
.form-actions { margin-top: 6px; display: flex; }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
    font: inherit;
}

.auth-submit {
    width: 100%;
    min-height: 50px;
    padding: 0 22px;
    border: 0;
    border-radius: 6px;
    background: var(--auth-ink);
    color: #ffffff;
    font-size: 0.98rem;
    font-weight: 800;
    transition: background-color var(--auth-transition-fast), box-shadow var(--auth-transition-fast);
}

.auth-submit:hover { background: #1b2a4d; }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px rgba(20, 98, 232, 0.3); }

/* Links under the form ("Forgot password?", switch between staff and portal login) */
.auth-login-meta,
.auth-login-switch {
    margin: 4px 0 0;
    font-size: 0.86rem;
    color: var(--auth-ink-muted);
}

.auth-login-meta a,
.auth-login-switch a,
.auth-login-card .auth-link {
    color: var(--auth-primary);
    font-weight: 700;
}

.auth-login-switch { margin-top: 18px; }

/* Small footer line inside the form column (e.g. "Sign out" on the portal chooser) */
.auth-login-foot {
    margin: 22px 0 0;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--auth-ink-muted);
}

.auth-login-foot-link { color: var(--auth-primary); font-weight: 700; }

/* ---------- Short windows (laptop screens): tighter so the whole page, band included, fits ---------- */
@media (max-height: 820px) and (min-width: 601px) {
    .auth-top { height: 66px; }
    .auth-top__logo { height: 44px; }
    .auth-aurora { padding: 18px 22px; }
    .auth-login-head { margin-bottom: 10px; }
    .auth-login-title { font-size: 1.6rem; }
    .auth-login-subtitle { margin-top: 4px; }
    .auth-form { gap: 12px; margin-top: 16px; }
    .crm-field, .form-group { gap: 5px; }
    .auth-form .form-control,
    .auth-form input:not([type="checkbox"]):not([type="radio"]) { min-height: 44px; }
    .form-actions { margin-top: 2px; }
    .auth-submit { min-height: 46px; }
    .auth-login-switch { margin-top: 10px; }
    .auth-maxborne { padding: 9px 32px; }
    .auth-maxborne__logo { height: 26px; }
}

/* ---------- Responsive ---------- */
@media (max-width: 600px) {
    .auth-top { height: 68px; padding: 0 16px; }
    .auth-top__logo { height: 40px; }
    .auth-top__help { display: none; }
    .auth-aurora { padding: 30px 16px; align-items: flex-start; }
    .auth-login-title { font-size: 1.6rem; }
    .auth-maxborne { padding: 14px 16px; justify-content: center; text-align: center; }
}
