/* LifeCare HRMS — authentication pages */
:root {
    --auth-bg: #f0f2f7;
    --auth-panel: #162032;
    --auth-panel-accent: #2563eb;
    --auth-text: #1f2937;
    --auth-muted: #6b7280;
    --auth-border: #e5e7eb;
    --auth-white: #ffffff;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body.auth-page {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--auth-bg);
    min-height: 100vh;
    color: var(--auth-text);
}

.auth-shell {
    display: flex;
    min-height: 100vh;
}

.auth-brand {
    flex: 1.05;
    background: linear-gradient(160deg, #1a2744 0%, #162032 45%, #0f172a 100%);
    color: #fff;
    padding: 48px 56px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    position: relative;
    overflow: hidden;
}

.auth-brand::before {
    content: '';
    position: absolute;
    width: 420px;
    height: 420px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(37,99,235,.22) 0%, transparent 70%);
    top: -120px;
    right: -80px;
    pointer-events: none;
}

.auth-brand::after {
    content: '';
    position: absolute;
    width: 280px;
    height: 280px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(59,130,246,.12) 0%, transparent 70%);
    bottom: -60px;
    left: -40px;
    pointer-events: none;
}

.auth-brand-inner { position: relative; z-index: 1; }

.auth-logo {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-bottom: 48px;
}

.auth-logo-mark {
    width: 48px;
    height: 48px;
    border-radius: 12px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: 0 8px 24px rgba(37,99,235,.35);
}

.auth-logo-text strong {
    display: block;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: -.02em;
}

.auth-logo-text small {
    display: block;
    font-size: .7rem;
    letter-spacing: .14em;
    text-transform: uppercase;
    opacity: .65;
    margin-top: 2px;
}

.auth-brand h1 {
    font-size: clamp(1.75rem, 3vw, 2.35rem);
    font-weight: 700;
    line-height: 1.2;
    margin-bottom: 16px;
    max-width: 380px;
}

.auth-brand .lead {
    font-size: 1rem;
    line-height: 1.65;
    color: rgba(255,255,255,.72);
    max-width: 400px;
}

.auth-features {
    margin-top: 40px;
    display: grid;
    gap: 14px;
    max-width: 360px;
}

.auth-feature {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: .9rem;
    color: rgba(255,255,255,.85);
}

.auth-feature i {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: rgba(255,255,255,.08);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #93c5fd;
    flex-shrink: 0;
}

.auth-brand-footer {
    position: relative;
    z-index: 1;
    font-size: .8rem;
    color: rgba(255,255,255,.45);
}

.auth-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 24px;
}

.auth-card {
    width: 100%;
    max-width: 400px;
}

.auth-card h2 {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--auth-text);
}

.auth-card .subtitle {
    color: var(--auth-muted);
    font-size: .95rem;
    margin-bottom: 28px;
}

.auth-field { margin-bottom: 18px; }

.auth-field label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--auth-text);
    margin-bottom: 6px;
}

.auth-input-wrap { position: relative; }

.auth-input-wrap i {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 14px;
}

.auth-input {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 0 14px 0 42px;
    font-size: 15px;
    background: var(--auth-white);
    transition: border-color .15s, box-shadow .15s;
}

.auth-input:focus {
    outline: none;
    border-color: var(--auth-panel-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-btn {
    width: 100%;
    height: 48px;
    border: none;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    margin-top: 8px;
    transition: transform .12s, box-shadow .12s;
    box-shadow: 0 4px 14px rgba(37,99,235,.28);
}

.auth-btn:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(37,99,235,.35);
}

.auth-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.auth-alert {
    padding: 12px 14px;
    border-radius: 10px;
    margin-bottom: 20px;
    font-size: .88rem;
}

.auth-alert-danger {
    background: #fef2f2;
    color: #b91c1c;
    border: 1px solid #fecaca;
}

.auth-alert-success {
    background: #f0fdf4;
    color: #15803d;
    border: 1px solid #bbf7d0;
}

.auth-footer-note {
    margin-top: 28px;
    text-align: center;
    font-size: .8rem;
    color: var(--auth-muted);
}

/* Branch selection */
.auth-branch-page .auth-form-panel { align-items: flex-start; padding-top: 32px; }
.auth-branch-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    max-width: 480px;
    margin: 0 auto 24px;
    padding: 0 4px;
}
.auth-logout {
    padding: 8px 14px;
    border-radius: 8px;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-muted);
    font-size: .85rem;
    cursor: pointer;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 6px;
}
.auth-logout:hover { border-color: #fca5a5; color: #dc2626; background: #fef2f2; }

.auth-welcome {
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    padding: 24px;
    margin-bottom: 20px;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
}

.auth-avatar {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0 auto 12px;
}

.auth-branch-card {
    background: #fff;
    border: 1px solid var(--auth-border);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,.04);
}

.auth-select {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
}

.auth-select:focus {
    outline: none;
    border-color: var(--auth-panel-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-branch-meta {
    margin-top: 16px;
    padding: 14px;
    background: #f8fafc;
    border-radius: 10px;
    font-size: .88rem;
    color: var(--auth-muted);
    display: none;
}

.auth-branch-meta.show { display: block; }

.auth-footer-note a { color: var(--auth-panel-accent); text-decoration: none; font-weight: 500; }
.auth-footer-note a:hover { text-decoration: underline; }
.auth-alert-success { background: #ecfdf5; color: #065f46; border: 1px solid #a7f3d0; }
.auth-org-code { margin-top: 12px; padding-top: 12px; border-top: 1px solid #a7f3d0; }
.auth-org-code span { display: block; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; opacity: .85; margin-bottom: 4px; }
.auth-org-code strong { font-size: 20px; letter-spacing: .06em; font-family: ui-monospace, monospace; }
.auth-form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.auth-card-wide { max-width: 720px; }
.auth-form-panel-wide { align-items: flex-start; padding-top: 48px; }
.auth-shell-register .auth-brand { flex: 0.9; }
.auth-form-section { margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--auth-border); }
.auth-form-section:last-of-type { border-bottom: none; margin-bottom: 8px; }
.auth-form-section-title { font-size: 15px; font-weight: 600; color: #111827; margin-bottom: 16px; display: flex; align-items: center; gap: 8px; }
.auth-form-section-title i { color: var(--auth-panel-accent); }
.auth-field-full { grid-column: 1 / -1; }
.auth-hint { display: block; margin-top: 6px; font-size: 12px; color: var(--auth-muted); }
.auth-file { padding: 10px 12px; height: auto; }
.auth-btn-wide { width: 100%; margin-top: 8px; }
.auth-error-list { margin: 8px 0 0 18px; padding: 0; }
.auth-error-list li { margin-bottom: 4px; }
.auth-capitalize { text-transform: capitalize; }
.auth-select {
    width: 100%;
    height: 48px;
    border: 1px solid var(--auth-border);
    border-radius: 10px;
    padding: 0 14px;
    font-size: 15px;
    background: #fff;
    cursor: pointer;
}
.auth-page-register .auth-select:focus {
    outline: none;
    border-color: var(--auth-panel-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-page-register .auth-select:focus {
    outline: none;
    border-color: var(--auth-panel-accent);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.auth-brand-paye .auth-logo-compact {
    margin-bottom: 28px;
}

.auth-paye-panel {
    max-width: 340px;
}

.auth-paye-mode {
    display: flex;
    gap: 0;
    margin-bottom: 8px;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.18);
    background: rgba(255, 255, 255, 0.06);
}

.auth-paye-mode-option {
    flex: 1;
    position: relative;
    cursor: pointer;
}

.auth-paye-mode-option input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.auth-paye-mode-option span {
    display: block;
    text-align: center;
    padding: 11px 16px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.72);
    transition: background 0.15s, color 0.15s;
}

.auth-paye-mode-option + .auth-paye-mode-option span {
    border-left: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-paye-mode-option input:checked + span {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
}

.auth-paye-mode-note {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.62);
    line-height: 1.4;
    margin-bottom: 22px;
}

.auth-paye-title {
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    margin-bottom: 14px;
    color: #fff;
}

.auth-paye-form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.auth-paye-field {
    width: 100%;
    height: 44px;
    border: none;
    border-radius: 6px;
    background: #e8eaed;
    color: #1f2937;
    padding: 0 14px;
    font-size: 14px;
    font-family: inherit;
}

.auth-paye-field::placeholder {
    color: #6b7280;
}

.auth-paye-field:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.35);
}

.auth-paye-select {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%236b7280' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
    cursor: pointer;
}

.auth-paye-select:invalid,
.auth-paye-select option[value=""] {
    color: #6b7280;
}

.auth-paye-check {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 14px;
    color: rgba(255, 255, 255, 0.92);
    cursor: pointer;
    padding: 4px 0;
}

.auth-paye-check input[type="checkbox"] {
    width: 18px;
    height: 18px;
    accent-color: #2563eb;
    cursor: pointer;
    flex-shrink: 0;
}

.auth-paye-results-method {
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: #93c5fd;
    margin-bottom: 8px;
}

.auth-paye-results-note {
    margin: 0 0 10px;
    font-size: 12px;
    color: rgba(255, 255, 255, 0.68);
    line-height: 1.4;
}

.auth-paye-btn {
    width: 100%;
    height: 46px;
    margin-top: 6px;
    border: none;
    border-radius: 6px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    cursor: pointer;
}

.auth-paye-btn:hover {
    filter: brightness(1.06);
}

.auth-paye-btn:disabled {
    opacity: 0.7;
    cursor: wait;
}

.auth-paye-error {
    margin: 0;
    font-size: 12px;
    color: #fecaca;
    line-height: 1.4;
}

.auth-paye-results {
    margin-top: 18px;
    padding-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-paye-results-head {
    font-size: 13px;
    font-weight: 600;
    margin-bottom: 10px;
    color: rgba(255, 255, 255, 0.9);
}

.auth-paye-breakdown {
    margin: 0;
}

.auth-paye-row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding: 6px 0;
    font-size: 13px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.auth-paye-row dt {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 400;
}

.auth-paye-row dd {
    margin: 0;
    font-weight: 600;
    color: #fff;
    text-align: right;
}

.auth-paye-row-highlight {
    margin-top: 4px;
    padding-top: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    border-bottom: none;
}

.auth-paye-row-highlight dt,
.auth-paye-row-highlight dd {
    font-size: 14px;
    color: #93c5fd;
}

.auth-paye-disclaimer {
    margin: 10px 0 0;
    font-size: 11px;
    color: rgba(255, 255, 255, 0.45);
    line-height: 1.4;
}

@media (max-width: 900px) {
    .auth-shell { flex-direction: column; }
    .auth-brand { padding: 36px 28px; min-height: auto; }
    .auth-brand h1 { font-size: 1.5rem; }
    .auth-features { display: none; }
    .auth-paye-panel { max-width: none; }
}

/* Error pages */
body.error-page {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
}

.error-shell {
    width: 100%;
    max-width: 520px;
    text-align: center;
}

.error-card {
    background: var(--auth-white);
    border: 1px solid var(--auth-border);
    border-radius: 16px;
    padding: 40px 32px 32px;
    box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.error-mark {
    width: 56px;
    height: 56px;
    margin: 0 auto 16px;
    border-radius: 14px;
    background: linear-gradient(135deg, #2563eb, #1d4ed8);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.error-code {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--auth-muted);
    margin-bottom: 8px;
}

.error-card h1 {
    font-size: 1.5rem;
    margin-bottom: 10px;
    color: var(--auth-text);
}

.error-message {
    color: var(--auth-muted);
    line-height: 1.6;
    margin-bottom: 24px;
}

.error-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
}

.error-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 16px;
    border-radius: 8px;
    border: 1px solid var(--auth-border);
    background: #fff;
    color: var(--auth-text);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
}

.error-btn:hover {
    background: #f9fafb;
}

.error-btn-primary {
    background: #2563eb;
    border-color: #2563eb;
    color: #fff;
}

.error-btn-primary:hover {
    background: #1d4ed8;
}

.error-foot {
    margin-top: 20px;
    font-size: 13px;
    color: var(--auth-muted);
}
