/*
 * Sign-in page (layouts/main-login.php + views/user/security/login.php).
 * Colours follow the app tokens in modern-table.css / modern-layout.css.
 * Selectors carry `body.auth-page` so they beat AdminLTE's .login-page rules.
 */

:root {
    --auth-primary: #4650dd;
    --auth-primary-dark: #343cb8;
    --auth-primary-soft: #eef0fd;
    --auth-title: #101828;
    --auth-text: #344054;
    --auth-muted: #667085;
    --auth-border: #d0d5dd;
    --auth-bg: #f5f6fa;
    --auth-danger: #d92d20;
}

body.auth-page {
    margin: 0;
    min-height: 100vh;
    background: var(--auth-bg);
    color: var(--auth-text);
    font-family: "Inter", "Segoe UI", -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
}

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

/* ---------- brand panel ---------- */

.auth-brand {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    flex: 0 0 44%;
    max-width: 640px;
    padding: 48px 56px;
    overflow: hidden;
    color: #fff;
    background: linear-gradient(150deg, #4650dd 0%, #343cb8 55%, #232a8a 100%);
}
.auth-brand::before,
.auth-brand::after {
    content: "";
    position: absolute;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    pointer-events: none;
}
.auth-brand::before { width: 420px; height: 420px; top: -140px; right: -160px; }
.auth-brand::after  { width: 300px; height: 300px; bottom: -120px; left: -90px; }

.auth-brand-top {
    position: relative;
    display: flex;
    align-items: center;
    gap: 12px;
}
.auth-logo {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: #fff;
    color: var(--auth-primary);
    font-size: 20px;
    font-weight: 700;
}
.auth-logo-name {
    font-size: 20px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

.auth-brand-body {
    position: relative;
    max-width: 440px;
}
.auth-brand-body h1 {
    margin: 0 0 16px;
    color: #fff;
    font-family: inherit;
    font-size: 36px;
    font-weight: 700;
    line-height: 1.2;
    letter-spacing: -0.02em;
}
.auth-brand-body p {
    margin: 0 0 32px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 16px;
    line-height: 1.6;
}
.auth-features {
    margin: 0;
    padding: 0;
    list-style: none;
}
.auth-features li {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 16px;
    font-size: 15px;
    color: rgba(255, 255, 255, 0.92);
}
.auth-features i {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 36px;
    height: 36px;
    border-radius: 9px;
    background: rgba(255, 255, 255, 0.14);
    font-size: 15px;
}

.auth-brand-foot {
    position: relative;
    color: rgba(255, 255, 255, 0.6);
    font-size: 13px;
}

/* ---------- form side ---------- */

.auth-main {
    display: flex;
    flex: 1;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}
.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-head { margin-bottom: 28px; }
.auth-head h2 {
    margin: 0 0 6px;
    color: var(--auth-title);
    font-family: inherit;
    font-size: 28px;
    font-weight: 700;
    letter-spacing: -0.02em;
}
.auth-head p {
    margin: 0;
    color: var(--auth-muted);
    font-size: 15px;
}

body.auth-page .auth-card .row { margin: 0; }
body.auth-page .auth-card .row > [class*="col-"] { padding: 0; }
body.auth-page .auth-card .alert {
    margin-bottom: 20px;
    border-radius: 8px;
    font-size: 13px;
}

body.auth-page .auth-card .form-group { margin-bottom: 20px; }
body.auth-page .auth-card .control-label {
    display: block;
    margin-bottom: 6px;
    color: var(--auth-text);
    font-size: 13px;
    font-weight: 600;
}
.auth-label-row {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
}
.auth-label-row .auth-link { font-size: 13px; }

.auth-input { position: relative; }
.auth-input > .fa {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    color: #98a2b3;
    font-size: 15px;
    pointer-events: none;
}
body.auth-page .auth-card .form-control {
    height: 44px;
    padding: 10px 14px 10px 40px;
    border: 1px solid var(--auth-border);
    border-radius: 8px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
    color: var(--auth-title);
    font-size: 14px;
    transition: border-color 0.15s, box-shadow 0.15s;
}
body.auth-page .auth-card select.form-control { padding-left: 14px; }
body.auth-page .auth-card .form-control::placeholder { color: #98a2b3; }
body.auth-page .auth-card .form-control:focus {
    border-color: var(--auth-primary);
    box-shadow: 0 0 0 4px rgba(70, 80, 221, 0.15);
    outline: 0;
}
body.auth-page .auth-card .auth-input-pw .form-control { padding-right: 44px; }
.auth-toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 44px;
    height: 44px;
    border: 0;
    background: transparent;
    color: #98a2b3;
    cursor: pointer;
}
.auth-toggle:hover,
.auth-toggle:focus { color: var(--auth-primary); outline: 0; }

body.auth-page .auth-card .has-error .form-control {
    border-color: var(--auth-danger);
}
body.auth-page .auth-card .has-error .form-control:focus {
    box-shadow: 0 0 0 4px rgba(217, 45, 32, 0.12);
}
body.auth-page .auth-card .has-error .control-label { color: var(--auth-text); }
body.auth-page .auth-card .help-block {
    margin: 6px 0 0;
    font-size: 13px;
}
body.auth-page .auth-card .help-block:empty { display: none; }
body.auth-page .auth-card .has-error .help-block { color: var(--auth-danger); }

/* remember me */
body.auth-page .auth-remember { margin-bottom: 24px; }
body.auth-page .auth-remember label {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    color: var(--auth-text);
    font-weight: 500;
    cursor: pointer;
}
body.auth-page .auth-remember input[type="checkbox"] {
    width: 16px;
    height: 16px;
    margin: 0;
    accent-color: var(--auth-primary);
}

/* submit */
body.auth-page .auth-submit {
    position: relative;
    height: 46px;
    border: 0;
    border-radius: 8px;
    background: var(--auth-primary);
    box-shadow: 0 1px 2px rgba(16, 24, 40, 0.08), 0 4px 12px rgba(70, 80, 221, 0.25);
    font-size: 15px;
    font-weight: 600;
    transition: background-color 0.15s, box-shadow 0.15s;
}
body.auth-page .auth-submit:hover,
body.auth-page .auth-submit:active { background: var(--auth-primary-dark); }
body.auth-page .auth-submit:focus {
    outline: 0;
    box-shadow: 0 0 0 4px rgba(70, 80, 221, 0.25);
}
.auth-spinner {
    display: none;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255, 255, 255, 0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: auth-spin 0.7s linear infinite;
}
.auth-submit.is-loading .auth-submit-text { visibility: hidden; }
.auth-submit.is-loading .auth-spinner {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    margin: -9px 0 0 -9px;
}
@keyframes auth-spin { to { transform: rotate(360deg); } }

/* links and footer */
body.auth-page .auth-link {
    color: var(--auth-primary);
    font-weight: 600;
}
body.auth-page .auth-link:hover { color: var(--auth-primary-dark); }
body.auth-page .auth-link-muted {
    color: var(--auth-muted);
    font-weight: 500;
}
.auth-foot {
    margin-top: 28px;
    text-align: center;
    color: var(--auth-muted);
    font-size: 14px;
}
.auth-foot p { margin: 0 0 8px; }
body.auth-page .auth-clients:empty { display: none; }

/* ---------- small screens: brand panel becomes a slim header ---------- */

@media (max-width: 991px) {
    .auth-shell { flex-direction: column; }
    .auth-brand {
        flex: none;
        max-width: none;
        padding: 20px 24px;
    }
    .auth-brand-body,
    .auth-brand-foot,
    .auth-brand::after { display: none; }
    .auth-main {
        align-items: flex-start;
        padding: 32px 16px;
    }
}
