/* ============================================================
   SARTS — login screen
   ============================================================ */

:root {
    --sarts-primary: #0d47a1;
    --sarts-primary-dark: #08306b;
    --sarts-accent: #1976d2;
}

.login-body {
    min-height: 100vh;
    margin: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    /* background:
    radial-gradient(1200px 600px at 10% -10%, rgba(25, 118, 210, .35), transparent 60%),
    radial-gradient(900px 500px at 110% 110%, rgba(13, 71, 161, .45), transparent 55%),
    linear-gradient(135deg, #0b2545 0%, #123a6b 55%, #0d47a1 100%); */
    font-family: var(--arms-font, 'Manrope', system-ui, sans-serif);
}

.login-shell {
    width: 100%;
    max-width: 460px;
}

.login-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    animation: cardIn .35s ease;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(14px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

/* ---------- brand header ---------- */

.login-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 22px 28px;
    background: linear-gradient(135deg, var(--sarts-primary) 0%, var(--sarts-accent) 100%);
    color: #fff;
}

.brand-mark {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border-radius: 12px;
    background: rgba(255, 255, 255, .18);
    display: grid;
    place-items: center;
    font-size: 1.5rem;
}

.brand-title {
    margin: 0;
    font-size: 1.35rem;
    font-weight: 600;
    letter-spacing: .4px;
}

.brand-sub {
    margin: 2px 0 0;
    font-size: .74rem;
    opacity: .85;
    line-height: 1.3;
}

.login-body-pad {
    padding: 28px;
}

.screen-title {
    font-size: 1.15rem;
    font-weight: 600;
    margin: 0 0 4px;
    color: #1a1a1a;
}

.screen-help {
    font-size: .875rem;
    color: #6c757d;
    margin-bottom: 20px;
}

.btn-back {
    padding: 0 0 10px;
    font-size: .85rem;
    text-decoration: none;
}

/* ---------- maths captcha ---------- */

.captcha-row {
    display: flex;
    gap: 8px;
    align-items: stretch;
}

.captcha-question {
    flex: 0 0 auto;
    min-width: 118px;
    display: grid;
    place-items: center;
    padding: 0 14px;
    border-radius: 8px;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: 2px;
    color: #263238;
    user-select: none;
    background:
        repeating-linear-gradient(45deg, #eceff1 0 6px, #e0e4e7 6px 12px);
    border: 1px solid #cfd8dc;
    /* mild distortion so simple OCR does not read it trivially */
    font-family: "Courier New", monospace;
    text-shadow: 1px 1px 0 rgba(255, 255, 255, .8);
    font-style: italic;
}

.captcha-refresh {
    flex: 0 0 auto;
}

.captcha-input {
    flex: 1 1 auto;
    min-width: 0;
}

/* ---------- OTP boxes ---------- */

.otp-inputs {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin: 8px 0 4px;
}

.otp-box {
    width: 48px;
    height: 56px;
    text-align: center;
    font-size: 1.5rem;
    font-weight: 600;
    border: 1.5px solid #ced4da;
    border-radius: 10px;
    background: #fff;
    transition: border-color .15s, box-shadow .15s;
}

.otp-box:focus {
    outline: 0;
    border-color: var(--sarts-accent);
    box-shadow: 0 0 0 .2rem rgba(25, 118, 210, .2);
}

.otp-box.is-filled {
    border-color: var(--sarts-accent);
    background: #f3f8ff;
}

.otp-box.is-error {
    border-color: #dc3545;
    background: #fff5f5;
}

/* ---------- footer ---------- */

.login-foot {
    padding: 12px 28px;
    background: #f8f9fa;
    border-top: 1px solid #e9ecef;
    text-align: center;
    font-size: .78rem;
    color: #6c757d;
}

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

@media (max-width: 420px) {
    .login-body-pad {
        padding: 20px;
    }

    .otp-box {
        width: 42px;
        height: 50px;
        font-size: 1.25rem;
    }

    .captcha-question {
        min-width: 96px;
        font-size: 1rem;
    }
}

/* Field-level error text stays visible without Bootstrap's :invalid coupling */
.invalid-feedback {
    display: block;
    min-height: 0;
}

.invalid-feedback:empty {
    display: none;
}

/* ---------- branding assets (public/img/logo) ---------- */

/* With a logo file present, the logo and the system name stack vertically.
   The card header switches to white so a full-colour logo reads correctly. */
.login-brand.has-logo {
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 18px;
    background: #ffffff;
    border-bottom: 1px solid #e9edf3;
    text-align: center;
}

.login-logo {
    max-height: 64px;
    max-width: 82%;
    width: auto;
    object-fit: contain;
}

/* System name beneath the logo — dark text, since the header is white here. */
.login-brand.has-logo .brand-title {
    margin: 0;
    font-size: .95rem;
    font-weight: 600;
    line-height: 1.35;
    letter-spacing: .2px;
    color: #12263f;
}

.footer-logo {
    height: 25px;
    width: auto;
    vertical-align: middle;
    margin-left: 2px;
    object-fit: contain;
}

@media (max-width: 420px) {
    .login-brand.has-logo .brand-title {
        font-size: .85rem;
    }

    .login-logo {
        max-height: 44px;
    }
}