/* ================================================================
   KLS Auth — Login / Reset / MFA screens
   Shares the same design-token palette as kls-modern.css
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

:root {
    --kls-auth-navy: #0b1a30;
    --kls-auth-blue: #175cd3;
    --kls-auth-blue-hover: #154fb8;
    --kls-auth-gold: #fdb022;
    --kls-auth-ink: #101828;
    --kls-auth-muted: #475467;
    --kls-auth-border: #eaecf0;
    --kls-auth-soft-border: #f2f4f7;
    --kls-auth-bg: #f8f9fc;
    --kls-auth-surface: #ffffff;
    --kls-auth-input-border: #d0d5dd;
    --kls-auth-focus-ring: rgba(23, 92, 211, 0.18);
    --kls-auth-danger: #d92d20;
    --kls-auth-success: #027a48;
    --kls-auth-radius: 12px;
    --kls-auth-radius-sm: 8px;
}

/* ── Shell & background ─────────────────────────────────────────── */
html,
body.kls-auth-shell {
    min-height: 100%;
    margin: 0;
    background: var(--kls-auth-bg);
    color: var(--kls-auth-ink);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.kls-auth-shell .page-container,
.kls-auth-shell .page-content,
.kls-auth-shell .content-wrapper,
.kls-auth-shell .content {
    min-height: 100vh;
    background: var(--kls-auth-bg);
}

.kls-auth-shell .content {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
}

/* ── Auth Card ──────────────────────────────────────────────────── */
.kls-auth-shell .login-form.kls-auth-card {
    width: 100%;
    max-width: 440px;
    margin: 0;
    padding: 36px 32px;
    border: 1px solid var(--kls-auth-border);
    border-radius: var(--kls-auth-radius);
    background: var(--kls-auth-surface);
    box-shadow:
        0 1px 3px rgba(16, 24, 40, 0.06),
        0 12px 32px -4px rgba(16, 24, 40, 0.08);
}

.kls-auth-shell .login-form.kls-auth-card-wide {
    max-width: 780px;
}

.kls-auth-shell .login-form.kls-access-card {
    max-width: 700px;
}

.kls-auth-shell .kls-access-options {
    border-top: 1px solid var(--kls-auth-border);
}

.kls-auth-shell .kls-access-option {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr) auto;
    gap: 16px;
    align-items: center;
    padding: 22px 0;
    border-bottom: 1px solid var(--kls-auth-border);
}

.kls-auth-shell .kls-access-icon {
    display: inline-flex;
    width: 44px;
    height: 44px;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: #f2f4f7;
    color: var(--kls-auth-navy);
    font-size: 20px;
}

.kls-auth-shell .kls-access-icon-member {
    background: #eff4ff;
    color: var(--kls-auth-blue);
}

.kls-auth-shell .kls-access-copy h3 {
    margin: 0;
    color: var(--kls-auth-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.kls-auth-shell .kls-access-copy p {
    margin: 4px 0 0;
    color: var(--kls-auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

.kls-auth-shell .kls-access-action {
    min-width: 150px;
    white-space: nowrap;
}

.kls-auth-shell .kls-application-section {
    margin: 0 0 24px;
    padding: 0 0 8px;
    border-bottom: 1px solid var(--kls-auth-border);
}

.kls-auth-shell .kls-application-section h3 {
    margin: 0 0 16px;
    color: var(--kls-auth-ink);
    font-size: 15px;
    font-weight: 700;
    line-height: 1.4;
}

.kls-auth-shell .kls-file-input {
    height: auto;
    min-height: 44px;
    padding: 8px 10px;
}

.kls-auth-shell .kls-application-consent {
    margin-bottom: 20px;
}

.kls-auth-shell .kls-password-requirements {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 16px;
    clear: both;
    width: 100%;
    margin: -4px 0 18px;
    color: var(--kls-auth-muted);
    font-size: 12px;
    line-height: 1.5;
}

.kls-auth-shell .kls-password-requirements > span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    white-space: nowrap;
    transition: color 0.15s ease;
}

.kls-auth-shell .kls-password-requirements .is-valid {
    color: var(--kls-auth-success);
}

.kls-auth-shell .kls-password-requirements .is-invalid {
    color: var(--kls-auth-danger);
}

.kls-auth-shell .form-control.is-password-valid {
    border-color: var(--kls-auth-success);
}

.kls-auth-shell .form-control.is-password-invalid {
    border-color: var(--kls-auth-danger);
}

.kls-wizard-ready .kls-wizard-step:not(.is-active) {
    display: none;
}

.kls-auth-shell .kls-wizard-progress {
    margin: 0 0 28px;
    border-bottom: 1px solid var(--kls-auth-border);
}

.kls-auth-shell .kls-wizard-progress ol {
    display: grid;
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 0;
    margin: 0;
    padding: 0;
    list-style: none;
}

.kls-auth-shell .kls-wizard-progress li {
    position: relative;
    display: flex;
    align-items: center;
    gap: 8px;
    min-width: 0;
    padding: 0 8px 14px;
    color: var(--kls-auth-muted);
    font-size: 12px;
}

.kls-auth-shell .kls-wizard-progress li:first-child {
    padding-left: 0;
}

.kls-auth-shell .kls-wizard-progress li::after {
    position: absolute;
    right: 0;
    bottom: -1px;
    left: 0;
    height: 2px;
    background: transparent;
    content: '';
}

.kls-auth-shell .kls-wizard-progress li.is-active::after,
.kls-auth-shell .kls-wizard-progress li.is-complete::after {
    background: var(--kls-auth-blue);
}

.kls-auth-shell .kls-wizard-progress li span {
    display: inline-flex;
    flex: 0 0 24px;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border: 1px solid var(--kls-auth-input-border);
    border-radius: 50%;
    background: var(--kls-auth-surface);
    color: var(--kls-auth-muted);
    font-weight: 600;
}

.kls-auth-shell .kls-wizard-progress li.is-active,
.kls-auth-shell .kls-wizard-progress li.is-complete {
    color: var(--kls-auth-ink);
}

.kls-auth-shell .kls-wizard-progress li.is-active span,
.kls-auth-shell .kls-wizard-progress li.is-complete span {
    border-color: var(--kls-auth-blue);
    color: var(--kls-auth-blue);
}

.kls-auth-shell .kls-wizard-progress strong {
    overflow: hidden;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.kls-auth-shell .kls-wizard-actions {
    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 12px;
}

.kls-auth-shell .kls-wizard-actions #wizard-position {
    color: var(--kls-auth-muted);
    font-size: 12px;
    text-align: center;
}

.kls-auth-shell .kls-wizard-actions #wizard-submit {
    display: none;
}

/* ── Brand block (logo + name) ──────────────────────────────────── */
.kls-auth-shell .kls-auth-brand {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 28px;
}

.kls-auth-shell .kls-auth-brand img {
    width: 44px;
    height: 44px;
    padding: 2px;
    border: 1px solid var(--kls-auth-border);
    border-radius: var(--kls-auth-radius-sm);
    background: var(--kls-auth-surface);
    object-fit: cover;
}

.kls-auth-shell .kls-auth-brand h1 {
    margin: 0;
    color: var(--kls-auth-ink);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.01em;
}

.kls-auth-shell .kls-auth-brand p {
    margin: 3px 0 0;
    color: var(--kls-auth-muted);
    font-size: 13px;
    font-weight: 400;
}

/* ── Title block ────────────────────────────────────────────────── */
.kls-auth-shell .kls-auth-title {
    margin-bottom: 22px;
}

.kls-auth-shell .kls-auth-title h2 {
    margin: 0;
    color: var(--kls-auth-ink);
    font-size: 22px;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: -0.02em;
}

.kls-auth-shell .kls-auth-title p {
    margin: 6px 0 0;
    color: var(--kls-auth-muted);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.5;
}

/* ── Form controls ──────────────────────────────────────────────── */
.kls-auth-shell .form-group {
    margin-bottom: 16px;
}

.kls-auth-shell label {
    color: var(--kls-auth-ink);
    font-size: 13px;
    font-weight: 500;
    margin-bottom: 6px;
}

.kls-auth-shell .form-control {
    height: 44px;
    padding: 10px 14px;
    border: 1px solid var(--kls-auth-input-border);
    border-radius: var(--kls-auth-radius-sm);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--kls-auth-ink);
    font-family: inherit;
    font-size: 14px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kls-auth-shell .form-control::placeholder {
    color: #98a2b3;
    font-weight: 400;
}

.kls-auth-shell .form-control:focus {
    border-color: var(--kls-auth-blue);
    box-shadow: 0 0 0 3px var(--kls-auth-focus-ring), 0 1px 2px rgba(16, 24, 40, 0.05);
    outline: none;
}

.kls-auth-shell .form-control-feedback {
    top: 2px;
    color: #98a2b3;
}

/* ── Has-feedback left icon offset ──────────────────────────────── */
.kls-auth-shell .has-feedback-left .form-control {
    padding-left: 40px;
}

/* ── Checkboxes & options row ───────────────────────────────────── */
.kls-auth-shell .checkbox-inline,
.kls-auth-shell .login-options,
.kls-auth-shell .login-options a {
    color: var(--kls-auth-muted);
    font-size: 13px;
    font-weight: 500;
}

.kls-auth-shell .login-options a:hover {
    color: var(--kls-auth-blue);
}

/* ── Links ──────────────────────────────────────────────────────── */
.kls-auth-shell a {
    color: var(--kls-auth-blue);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.15s ease;
}

.kls-auth-shell a:hover {
    color: var(--kls-auth-blue-hover);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.kls-auth-shell .btn {
    min-height: 44px;
    padding: 10px 20px;
    border-radius: var(--kls-auth-radius-sm);
    border: 1px solid transparent;
    font-family: inherit;
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease, transform 0.1s ease;
}

.kls-auth-shell .btn:active {
    transform: translateY(1px);
}

/* Primary / submit */
.kls-auth-shell .btn.bg-pink-400,
.kls-auth-shell .btn-primary,
.kls-auth-shell .kls-auth-primary {
    border-color: var(--kls-auth-blue) !important;
    background-color: var(--kls-auth-blue) !important;
    color: #ffffff !important;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.kls-auth-shell .btn.bg-pink-400:hover,
.kls-auth-shell .btn-primary:hover,
.kls-auth-shell .kls-auth-primary:hover {
    background-color: var(--kls-auth-blue-hover) !important;
    box-shadow: 0 2px 6px rgba(23, 92, 211, 0.2);
}

/* Secondary / back */
.kls-auth-shell .btn-default {
    border-color: var(--kls-auth-border);
    background: var(--kls-auth-surface);
    color: var(--kls-auth-ink);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
}

.kls-auth-shell .btn-default:hover {
    background: var(--kls-auth-soft-border);
}

/* ── Alerts ─────────────────────────────────────────────────────── */
.kls-auth-shell .alert {
    border-radius: var(--kls-auth-radius-sm);
    font-size: 13px;
    font-weight: 500;
    padding: 12px 16px;
}

.kls-auth-shell .alert ul {
    margin-bottom: 0;
    padding-left: 18px;
}

.kls-auth-shell .alert-danger {
    background: #fef3f2;
    border-color: #fecdca;
    color: var(--kls-auth-danger);
}

.kls-auth-shell .alert-success {
    background: #ecfdf3;
    border-color: #abefc6;
    color: var(--kls-auth-success);
}

/* ── Divider ────────────────────────────────────────────────────── */
.kls-auth-shell .content-divider {
    margin: 22px 0 16px;
    border-top-color: var(--kls-auth-border);
}

.kls-auth-shell .kls-auth-secondary-action {
    margin-top: 12px;
}

/* ── OTP grid (MFA verify) ──────────────────────────────────────── */
.kls-auth-shell .kls-otp-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px;
    margin-bottom: 20px;
}

.kls-auth-shell .kls-otp-input {
    width: 100%;
    height: 52px;
    padding: 0;
    border: 1px solid var(--kls-auth-input-border);
    border-radius: var(--kls-auth-radius-sm);
    background: var(--kls-auth-surface);
    color: var(--kls-auth-ink);
    font-family: inherit;
    font-size: 22px;
    font-weight: 700;
    line-height: 52px;
    text-align: center;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.kls-auth-shell .kls-otp-input:focus {
    border-color: var(--kls-auth-blue);
    outline: 0;
    box-shadow: 0 0 0 3px var(--kls-auth-focus-ring), 0 1px 2px rgba(16, 24, 40, 0.05);
}

/* ── Helper note text ───────────────────────────────────────────── */
.kls-auth-shell .kls-auth-note {
    margin: -4px 0 18px;
    color: var(--kls-auth-muted);
    font-size: 13px;
    line-height: 1.5;
}

/* ── Footer / powered-by ────────────────────────────────────────── */
.kls-auth-shell .kls-auth-footer {
    margin-top: 24px;
    text-align: center;
    color: var(--kls-auth-muted);
    font-size: 12px;
}

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .kls-auth-shell .content {
        align-items: flex-start;
        padding-top: 24px;
    }

    .kls-auth-shell .login-form.kls-auth-card {
        padding: 24px 20px;
        border-radius: var(--kls-auth-radius-sm);
        box-shadow: 0 1px 3px rgba(16, 24, 40, 0.06);
    }

    .kls-auth-shell .kls-auth-title h2 {
        font-size: 20px;
    }

    .kls-auth-shell .kls-otp-grid {
        gap: 6px;
    }

    .kls-auth-shell .kls-otp-input {
        height: 46px;
        font-size: 18px;
        line-height: 46px;
    }

    .kls-auth-shell .kls-wizard-progress li {
        justify-content: center;
        padding-right: 2px;
        padding-left: 2px;
    }

    .kls-auth-shell .kls-wizard-progress strong {
        display: none;
    }

    .kls-auth-shell .kls-access-option {
        grid-template-columns: 44px minmax(0, 1fr);
        gap: 12px;
    }

    .kls-auth-shell .kls-access-action {
        grid-column: 1 / -1;
        width: 100%;
    }
}

@media (min-width: 481px) and (max-width: 768px) {
    .kls-auth-shell .content {
        padding: 32px 24px;
    }
}

.kls-auth-shell .kls-auth-otp-resend {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid var(--kls-auth-border);
}

.kls-auth-shell .kls-auth-otp-resend .btn-default {
    width: 100%;
}

.kls-auth-shell .kls-auth-otp-resend .btn-default:disabled {
    cursor: wait;
    opacity: .65;
}
