/* ==========================================================================
   SALAMA HOSTING — Admin Portal sign-in pages (sign in, code, password reset,
   locked account, two-factor setting)

   Same look and the same sp-auth-* classes as the customer portal's redesign
   (SOLID-PRINCIPLES-redesign/static/assets/dist/css/salama-auth.css, "Teeka Pro"):
   an ice-blue page ruled with faint vertical lines, one white card with 20px
   corners and a hairline edge, EB Garamond headings, 48px fields, a full-width
   navy button, and a deep-blue brand panel on the right with a yellow action.

   Loaded on its own after adminlte.min.css (for Bootstrap) by common/authHead.php.
   Layout: authHead.php opens .sp-auth-sheet > .sp-auth-sheet__inner > .sp-auth-form,
   each template fills the form, authFoot.php closes it and adds the legal footer
   and the brand panel.
   ========================================================================== */

:root {
    --sp-auth-primary: #0B2538;
    --sp-auth-primary-hover: #061826;
    --sp-auth-on-primary: #ffffff;
    --sp-auth-navy: #0B2538;
    --sp-auth-heading: #0B2538;
    --sp-auth-label: #33566C;
    --sp-auth-muted: #587486;
    --sp-auth-link: #0B2538;
    /* Field edges: 3.1:1 against white */
    --sp-auth-edge: #7E95A4;
    --sp-rule: #D5E5EE;

    /* Brand panel: the portal sidebar's deep blue, sky ticks, a yellow action */
    --sp-auth-navy-deep: #003153;
    --sp-auth-accent: #AEE0F1;
    --sp-auth-cta: #FED801;
    --sp-auth-cta-hover: #F0CB00;

    --sp-bg-surface: #ffffff;
    --sp-bg-canvas: #F3FBFF;
    --sp-gray-100: #E8F2F8;
    --sp-gray-200: #D5E5EE;
    --sp-gray-400: #587486;
    --sp-mint-line: #A9E4D5;
    --sp-mint-wash: #ECFBF7;

    --sp-state-success: #15803d;
    --sp-state-danger: #b91c1c;

    --sp-font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    --sp-font-display: 'EB Garamond', Garamond, 'Times New Roman', Georgia, serif;

    --sp-radius-sm: 8px;
    --sp-radius-md: 12px;
    --sp-radius-lg: 20px;
    --sp-radius-full: 9999px;
    --sp-focus-ring: 0 0 0 3px rgba(11, 37, 56, 0.14);
    --sp-transition-fast: 120ms cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- Base ---------- */
body.sp-auth-body {
    margin: 0;
    background: var(--sp-bg-canvas);
    color: var(--sp-auth-heading);
    font-family: var(--sp-font-sans);
    font-size: 14px;
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.sp-auth-body main.sp-auth-main {
    min-height: 100vh;
    min-height: 100dvh;
    padding: 0;
}

.sp-auth-body .sp-auth-row {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
}

/* ---------- Left: the form side, an ice-blue page with faint vertical rules ---------- */
.sp-auth-sheet {
    position: relative;
    isolation: isolate;
    display: flex;
    flex: 1 1 50%;
    flex-direction: column;
    align-items: center;
    min-width: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding: clamp(24px, 5vh, 56px) clamp(16px, 4vw, 40px);
    background: var(--sp-bg-canvas);
}

.sp-auth-sheet::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    pointer-events: none;
    background:
        linear-gradient(rgba(11, 37, 56, 0.06), rgba(11, 37, 56, 0.06)) 8% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(11, 37, 56, 0.03), rgba(11, 37, 56, 0.03)) 30% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(11, 37, 56, 0.03), rgba(11, 37, 56, 0.03)) 70% 0 / 1px 100% no-repeat,
        linear-gradient(rgba(11, 37, 56, 0.06), rgba(11, 37, 56, 0.06)) 92% 0 / 1px 100% no-repeat;
}

/* The card: white, a hairline edge, 20px corners, centred between top and footer */
.sp-auth-sheet__inner {
    width: 100%;
    max-width: 440px;
    margin: auto 0;
    padding: 32px;
    border: 1px solid var(--sp-rule);
    border-radius: var(--sp-radius-lg);
    background: var(--sp-bg-surface);
}

.sp-auth-brand {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin: 0 0 1.5rem;
    text-decoration: none !important;
}

.sp-auth-brand img {
    display: block;
    width: auto;
    height: 38px;
}

/* "Administrative Portal" chip under the logo */
.sp-auth-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 3px 10px;
    border: 1px solid var(--sp-rule);
    border-radius: var(--sp-radius-full);
    background: var(--sp-gray-100);
    color: var(--sp-auth-label);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

/* ---------- Headings and intro ---------- */
.sp-auth-sheet h1 {
    margin: 0 0 0.5rem;
    color: var(--sp-auth-heading);
    font-family: var(--sp-font-display);
    font-size: 32px;
    font-weight: 600;
    line-height: 1.15;
    letter-spacing: -0.01em;
    text-align: center;
}

.sp-auth-sheet .sp-auth-form > p,
.sp-auth-intro {
    margin: 0 0 1.75rem;
    color: var(--sp-auth-label);
    font-size: 14px;
    line-height: 1.6;
    text-align: center;
}

/* ---------- Fields ---------- */
.sp-auth-sheet .form-group {
    margin-bottom: 1.25rem;
}

.sp-auth-sheet label {
    display: block;
    margin-bottom: 0.5rem !important;
    color: var(--sp-auth-heading);
    font-size: 13px !important;
    font-weight: 700 !important;
}

.sp-auth-sheet .form-control {
    height: auto;
    min-height: 48px;
    padding: 0 14px;
    border: 1px solid var(--sp-auth-edge);
    border-radius: var(--sp-radius-md);
    background: var(--sp-bg-surface);
    color: var(--sp-auth-heading);
    font-family: var(--sp-font-sans);
    /* 16px: smaller text makes iOS zoom the page when a field is tapped */
    font-size: 1rem;
    box-shadow: none;
}

.sp-auth-sheet .form-control::placeholder {
    color: var(--sp-gray-400);
}

.sp-auth-sheet .form-control:focus {
    border-color: var(--sp-auth-navy);
    box-shadow: var(--sp-focus-ring);
}

/* A field with an icon inside it, on the left */
.sp-auth-field-icon {
    position: relative;
}

.sp-auth-field-icon > i {
    position: absolute;
    top: 50%;
    left: 15px;
    z-index: 4;
    color: var(--sp-auth-muted);
    font-size: 14px;
    pointer-events: none;
    transform: translateY(-50%);
}

.sp-auth-sheet .sp-auth-field-icon .form-control {
    padding-left: 42px;
}

/* The reveal-password button sits inside the field */
.sp-auth-sheet .input-group {
    position: relative;
    flex-wrap: nowrap;
}

.sp-auth-sheet .input-group > .form-control {
    padding-right: 3rem;
    border-radius: var(--sp-radius-md) !important;
}

.sp-auth-sheet .input-group-append {
    position: absolute;
    top: 1px;
    right: 1px;
    bottom: 1px;
    z-index: 5;
    display: flex;
    align-items: center;
    margin: 0;
}

.sp-auth-sheet .input-group-append .btn {
    width: 44px;
    height: 100%;
    min-height: 0;
    padding: 0;
    border: 0;
    border-radius: 0 var(--sp-radius-md) var(--sp-radius-md) 0;
    background: transparent;
    color: var(--sp-gray-400);
    box-shadow: none;
}

.sp-auth-sheet .input-group-append .btn:hover,
.sp-auth-sheet .input-group-append .btn:focus {
    background: transparent;
    color: var(--sp-auth-heading);
}

.sp-auth-hint {
    display: block;
    margin-top: 6px;
    color: var(--sp-auth-muted);
    font-size: 12.5px;
}

.sp-auth-hint.is-warning {
    color: #6b4f00;
    font-weight: 600;
}

/* Remember me on the left, recovery link on the right */
.sp-auth-field-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 0.5rem 1rem;
    margin: -0.25rem 0 1.5rem;
    font-size: 14px;
}

.sp-auth-sheet .custom-control-label {
    margin-bottom: 0 !important;
    color: var(--sp-auth-heading);
    font-size: 14px !important;
    font-weight: 500 !important;
    line-height: 1.5rem;
}

.sp-auth-sheet .custom-checkbox .custom-control-label::before {
    border-radius: 6px;
}

.sp-auth-sheet .custom-control-input:checked ~ .custom-control-label::before {
    border-color: var(--sp-auth-navy);
    background-color: var(--sp-auth-navy);
}

.sp-auth-sheet .custom-control-input:focus ~ .custom-control-label::before {
    box-shadow: var(--sp-focus-ring);
}

/* ---------- Buttons ---------- */
.sp-auth-sheet .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    border-radius: var(--sp-radius-md);
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    transition: background-color var(--sp-transition-fast), transform var(--sp-transition-fast);
}

.sp-auth-sheet .btn > i {
    margin-right: 0 !important;
    line-height: 1;
}

.sp-auth-sheet .btn-block {
    display: flex;
    width: 100%;
    min-height: 48px;
    font-size: 15px;
}

.sp-auth-sheet .btn-primary {
    border-color: var(--sp-auth-primary);
    background-color: var(--sp-auth-primary);
    color: var(--sp-auth-on-primary);
}

.sp-auth-sheet .btn-primary:hover,
.sp-auth-sheet .btn-primary:focus,
.sp-auth-sheet .btn-primary:not(:disabled):not(.disabled):active {
    border-color: var(--sp-auth-primary-hover);
    background-color: var(--sp-auth-primary-hover);
    color: var(--sp-auth-on-primary);
}

.sp-auth-sheet .btn-primary:not(:disabled):not(.disabled):hover {
    transform: translateY(-1px);
}

.sp-auth-sheet .btn:focus-visible {
    outline: 2px solid var(--sp-auth-navy);
    outline-offset: 2px;
    box-shadow: var(--sp-focus-ring);
}

.sp-auth-sheet .btn:disabled,
.sp-auth-sheet .btn.disabled {
    border-color: var(--sp-gray-200);
    background-color: var(--sp-gray-200);
    color: var(--sp-gray-400);
    opacity: 1;
    cursor: not-allowed;
    transform: none;
}

.sp-auth-sheet .btn-outline-secondary {
    min-height: 48px;
    padding: 0 1.25rem;
    border-color: rgba(11, 37, 56, 0.3);
    background: #ffffff;
    color: var(--sp-auth-navy);
}

.sp-auth-sheet .btn-outline-secondary:hover,
.sp-auth-sheet .btn-outline-secondary:focus {
    border-color: rgba(11, 37, 56, 0.3);
    background: var(--sp-gray-100);
    color: var(--sp-auth-navy);
}

/* Secondary actions under a form: "Back to sign in", "Send a new link" */
.sp-auth-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-top: 4px;
}

.sp-auth-actions > .btn {
    flex: 1 1 auto;
}

/* "Back to sign in" style row under the form */
.sp-auth-alt {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 0.375rem;
    margin-top: 1.5rem;
    color: var(--sp-auth-heading);
    font-size: 14px;
    text-align: center;
}

.sp-auth-alt > i {
    color: var(--sp-auth-label);
}

/* ---------- Links: bold navy, underlined in mint ---------- */
.sp-auth-sheet a:not(.btn):not(.sp-auth-brand) {
    color: var(--sp-auth-link);
    font-weight: 700;
    text-decoration: underline;
    text-decoration-color: var(--sp-mint-line);
    text-decoration-thickness: 2px;
    text-underline-offset: 3px;
}

.sp-auth-sheet a:not(.btn):not(.sp-auth-brand):hover,
.sp-auth-sheet a:not(.btn):not(.sp-auth-brand):focus {
    color: var(--sp-auth-link);
    text-decoration-color: var(--sp-auth-navy);
}

/* ---------- Messages (server feedback arrives as a Bootstrap .alert) ---------- */
.sp-auth-sheet .alert {
    margin-bottom: 1.25rem;
    padding: 0.875rem 1rem;
    border: 1px solid transparent;
    border-radius: var(--sp-radius-md);
    font-size: 13px;
    font-weight: 500;
    line-height: 1.6;
    text-align: left;
}

.sp-auth-sheet .alert .fa,
.sp-auth-sheet .alert .fas {
    margin-right: 4px;
}

.sp-auth-sheet .alert-info,
.sp-auth-sheet .alert-primary {
    border-color: var(--sp-mint-line);
    background: var(--sp-mint-wash);
    color: var(--sp-auth-navy);
}

.sp-auth-sheet .alert-success {
    border-color: #c8ecd5;
    background: #ecfdf3;
    color: #14532d;
}

.sp-auth-sheet .alert-warning {
    border-color: #f5e3a3;
    background: #fffbe6;
    color: #6b4f00;
}

.sp-auth-sheet .alert-danger {
    border-color: #f6d0d0;
    background: #fef2f2;
    color: #7f1d1d;
}

.sp-auth-sheet .alert a {
    color: inherit !important;
}

/* ---------- Outcome screens (locked account, link expired) ---------- */
.sp-auth-result-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    border-radius: var(--sp-radius-lg);
    font-size: 2rem;
}

.sp-auth-result-icon--centered {
    margin: 0 auto 1.5rem;
}

.sp-auth-result-icon.info    { background: var(--sp-mint-wash); color: var(--sp-auth-navy); }
.sp-auth-result-icon.success { background: #ecfdf3; color: var(--sp-state-success); }
.sp-auth-result-icon.danger  { background: #fef2f2; color: var(--sp-state-danger); }
.sp-auth-result-icon.warning { background: #fffbe6; color: #8a5a12; }

.sp-auth-text {
    margin: 0 0 1rem;
    color: var(--sp-auth-label);
    font-size: 14px;
    text-align: center;
}

/* ---------- One-time code boxes (built by views/settings/otp.php) ---------- */
.sp-otp-inputs {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin: 8px 0 24px;
}

.sp-otp-inputs input {
    width: 50px;
    height: 58px;
    padding: 0;
    border: 1px solid var(--sp-auth-edge);
    border-radius: var(--sp-radius-md);
    background: #fff;
    color: var(--sp-auth-heading);
    font-family: var(--sp-font-sans);
    font-size: 24px;
    font-weight: 600;
    text-align: center;
    outline: none;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.sp-otp-inputs input:focus {
    border-color: var(--sp-auth-navy);
    box-shadow: var(--sp-focus-ring);
}

/* ---------- Two-factor switch ---------- */
.sp-auth-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 16px;
    border: 1px solid var(--sp-rule);
    border-radius: var(--sp-radius-md);
    background: var(--sp-gray-100);
}

.sp-auth-switch .custom-control-label::before,
.sp-auth-switch .custom-control-label::after {
    cursor: pointer;
}

/* ---------- Legal footer: bottom of the form side ---------- */
.sp-auth-legal {
    width: 100%;
    margin-top: 2rem;
    color: var(--sp-auth-label);
    font-size: 13px;
    line-height: 1.7;
    text-align: center;
}

.sp-auth-legal p {
    margin: 0;
}

.sp-auth-legal p + p {
    margin-top: 0.25rem;
}

.sp-auth-legal a {
    color: var(--sp-auth-heading);
    text-decoration: none;
}

.sp-auth-legal a:hover,
.sp-auth-legal a:focus {
    color: var(--sp-auth-heading);
    text-decoration: underline;
}

/* ---------- Right: the brand panel ---------- */
.sp-auth-promo {
    position: sticky;
    top: 0;
    align-self: flex-start;
    display: flex;
    flex: 1 1 50%;
    flex-direction: column;
    justify-content: center;
    height: 100vh;
    height: 100dvh;
    overflow: hidden;
    padding: clamp(32px, 5vw, 72px);
    background: var(--sp-auth-navy-deep);
    color: #ffffff;
    isolation: isolate;
}

.sp-auth-promo::before {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -2;
    background: url('../../img/auth-panel.jpg') center / cover no-repeat;
    opacity: 0.55;
}

.sp-auth-promo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(180deg, rgba(0, 49, 83, 0.82) 0%, rgba(0, 49, 83, 0.96) 100%);
}

.sp-auth-promo__content {
    width: 100%;
    max-width: 440px;
    margin: 0 auto;
    text-align: center;
}

.sp-auth-promo__eyebrow {
    display: inline-block;
    margin-bottom: 1.25rem;
    padding: 0.375rem 0.875rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: var(--sp-radius-full);
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.sp-auth-promo__title {
    margin: 0 0 1rem;
    color: #ffffff;
    font-family: var(--sp-font-display);
    font-size: clamp(2rem, 3vw, 2.75rem);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: -0.01em;
}

.sp-auth-promo__text {
    margin: 0 0 2rem;
    color: rgba(255, 255, 255, 0.84);
    font-size: 1rem;
    line-height: 1.7;
}

.sp-auth-promo__points {
    display: grid;
    gap: 0.875rem;
    margin: 0 0 2.25rem;
    padding: 0;
    list-style: none;
    text-align: left;
}

.sp-auth-promo__points li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    color: rgba(255, 255, 255, 0.92);
    font-size: 0.9375rem;
    line-height: 1.5;
}

.sp-auth-promo__points i {
    flex: 0 0 18px;
    margin-top: 4px;
    color: var(--sp-auth-accent);
    font-size: 0.875rem;
    text-align: center;
}

.sp-auth-promo__cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 0 1.75rem;
    border-radius: var(--sp-radius-md);
    background: var(--sp-auth-cta);
    color: var(--sp-auth-navy) !important;
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none !important;
    transition: background-color var(--sp-transition-fast);
}

.sp-auth-promo__cta:hover,
.sp-auth-promo__cta:focus {
    background: var(--sp-auth-cta-hover);
    color: var(--sp-auth-navy) !important;
}

/* ---------- Small screens: the brand panel goes, the form fills ---------- */
@media (max-width: 1023.98px) {
    .sp-auth-promo {
        display: none;
    }

    .sp-auth-sheet {
        flex-basis: 100%;
        padding: 32px 16px;
    }
}

@media (max-width: 575.98px) {
    .sp-auth-sheet__inner {
        max-width: none;
        padding: 24px 20px;
    }

    .sp-auth-brand img {
        height: 32px;
    }

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

    .sp-otp-inputs {
        gap: 7px;
    }

    .sp-otp-inputs input {
        width: 42px;
        height: 50px;
        font-size: 21px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-auth-sheet .btn,
    .sp-auth-sheet .btn-primary:not(:disabled):not(.disabled):hover {
        transition: none;
        transform: none;
    }
}
