/* ============================================================
   auth.css — Richy Care Portal Authentication Screens
   Richy Care and Recruitment Limited
   Loads after custom.css + theme-override.css.
   Uses existing CSS variable tokens — no new colours defined.
   ============================================================ */

/* ── Reset / Body ─────────────────────────────────────────── */
.auth-body {
    margin: 0;
    padding: 0;
    min-height: 100vh;
    background: var(--bg-color, #f8f9fc);
    font-family: 'Onest', sans-serif;
}

/* ── Wrapper: side-by-side panels ─────────────────────────── */
.auth-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ── Left Brand Panel ─────────────────────────────────────── */
.auth-brand-panel {
    position: relative;
    flex: 0 0 45%;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    overflow: hidden;

    /* Fallback before JS/CSS kicks in */
    background-color: var(--primary-color);
    background-image: url('../images/hero-bg-image.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* Blue gradient overlay */
.auth-brand-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg,
            rgba(var(--primary-color-rgb), 0.88) 0%,
            rgba(var(--primary-color-rgb), 0.60) 40%,
            rgba(var(--primary-color-rgb), 0.92) 100%);
    z-index: 1;
}

/* All brand content sits above the overlay */
.auth-brand-content,
.auth-brand-footer {
    position: relative;
    z-index: 2;
}

.auth-brand-content {
    padding: 3rem 2.5rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    flex: 1;
    justify-content: center;
}

/* Logo */
.auth-brand-logo img {
    height: 52px;
    width: auto;
    filter: brightness(0) invert(1); /* white logo on dark panel */
    transition: opacity 0.2s ease;
}

.auth-brand-logo:hover img {
    opacity: 0.85;
}

/* Portal badge */
.auth-brand-badge span {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 50px;
    padding: 0.35rem 1rem;
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    backdrop-filter: blur(6px);
}

/* Tagline */
.auth-brand-tagline h2 {
    font-size: clamp(1.6rem, 2.2vw, 2.4rem);
    font-weight: 700;
    color: #ffffff;
    line-height: 1.25;
    margin: 0 0 1rem;
}

.auth-brand-tagline p {
    font-size: 0.97rem;
    color: rgba(255, 255, 255, 0.80);
    line-height: 1.65;
    margin: 0;
    max-width: 380px;
}

/* Trust items */
.auth-brand-trust {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.auth-trust-item {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    color: rgba(255, 255, 255, 0.90);
    font-size: 0.88rem;
    font-weight: 500;
}

.auth-trust-item i {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.15);
    color: var(--accent-color, #419443);
    font-size: 0.85rem;
    flex-shrink: 0;
}

/* Brand footer */
.auth-brand-footer {
    padding: 1.25rem 2.5rem;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.auth-brand-footer p {
    margin: 0;
    font-size: 0.78rem;
    color: rgba(255, 255, 255, 0.55);
}

/* ── Right Form Panel ─────────────────────────────────────── */
.auth-form-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    background: #ffffff;
    overflow-y: auto;
}

.auth-mobile-logo {
    display: none;
    padding: 1.5rem 2rem 0;
    width: 100%;
}

.auth-form-inner {
    width: 100%;
    max-width: 440px;
    padding: 3rem 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.auth-form-footer {
    padding: 1.25rem 2rem;
    width: 100%;
    text-align: center;
    border-top: 1px solid var(--divider-color, #20409a1A);
}

.auth-form-footer p {
    margin: 0;
    font-size: 0.82rem;
    color: var(--text-color);
    opacity: 0.65;
}

.auth-form-footer a {
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-form-footer a:hover {
    color: var(--accent-color);
}

/* ── Auth Form Heading ────────────────────────────────────── */
.auth-form-header {
    margin-bottom: 2rem;
}

.auth-form-header .auth-screen-label {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--accent-color, #419443);
    margin-bottom: 0.65rem;
}

.auth-form-header h1 {
    font-size: clamp(1.5rem, 2.5vw, 2rem);
    font-weight: 700;
    color: var(--text-color, #333333);
    margin: 0 0 0.5rem;
    line-height: 1.2;
}

.auth-form-header p {
    font-size: 0.93rem;
    color: #6b7280;
    margin: 0;
    line-height: 1.6;
}

/* ── Form Controls ────────────────────────────────────────── */
.auth-form .form-group {
    margin-bottom: 1.25rem;
}

.auth-form label {
    display: block;
    font-size: 0.84rem;
    font-weight: 600;
    color: var(--text-color, #333333);
    margin-bottom: 0.45rem;
}

.auth-form .form-control {
    width: 100%;
    height: 48px;
    padding: 0.6rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.94rem;
    font-family: 'Onest', sans-serif;
    color: var(--text-color);
    background: #fafbfc;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
    outline: none;
}

.auth-form .form-control:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb), 0.10);
    background: #ffffff;
}

.auth-form .form-control::placeholder {
    color: #b0b8c8;
    font-size: 0.9rem;
}

/* Input with icon wrapper */
.auth-input-group {
    position: relative;
}

.auth-input-group .auth-input-icon {
    position: absolute;
    left: 1rem;
    top: 50%;
    transform: translateY(-50%);
    color: #9ca3af;
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.auth-input-group .form-control {
    padding-left: 2.75rem;
}

.auth-input-group:focus-within .auth-input-icon {
    color: var(--primary-color);
}

/* Password toggle button */
.auth-input-group .auth-pwd-toggle {
    position: absolute;
    right: 1rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: #9ca3af;
    cursor: pointer;
    font-size: 0.9rem;
    padding: 0;
    line-height: 1;
    transition: color 0.2s;
}

.auth-input-group .auth-pwd-toggle:hover {
    color: var(--primary-color);
}

/* ── Remember me / inline links ──────────────────────────── */
.auth-form-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.auth-form-check {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.85rem;
    color: var(--text-color);
    cursor: pointer;
    user-select: none;
}

.auth-form-check input[type="checkbox"] {
    width: 16px;
    height: 16px;
    accent-color: var(--primary-color);
    cursor: pointer;
    flex-shrink: 0;
}

.auth-form-link {
    font-size: 0.85rem;
    color: var(--primary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.auth-form-link:hover {
    color: var(--accent-color);
    text-decoration: underline;
}

/* ── Submit Button ────────────────────────────────────────── */
.auth-form .btn-default {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 50px;
    font-size: 0.95rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    border-radius: 10px;
    transition: all 0.25s ease;
}

/* ── Divider ──────────────────────────────────────────────── */
.auth-divider {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin: 1.5rem 0;
    color: #cbd5e1;
    font-size: 0.8rem;
}

.auth-divider::before,
.auth-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: #e2e8f0;
}

/* ── Success / Info box ───────────────────────────────────── */
.auth-info-box {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.9rem 1rem;
    border-radius: 10px;
    margin-bottom: 1.5rem;
    font-size: 0.875rem;
    line-height: 1.55;
}

.auth-info-box.info {
    background: rgba(var(--primary-color-rgb), 0.07);
    border-left: 3px solid var(--primary-color);
    color: var(--primary-color);
}

.auth-info-box.success {
    background: rgba(65, 148, 67, 0.08);
    border-left: 3px solid var(--accent-color);
    color: #2d6e2e;
}

.auth-info-box.warning {
    background: rgba(234, 179, 8, 0.10);
    border-left: 3px solid #ca8a04;
    color: #78350f;
}

.auth-info-box i {
    margin-top: 0.1rem;
    flex-shrink: 0;
    font-size: 1rem;
}

/* ── Password Strength Meter ──────────────────────────────── */
.auth-strength-meter {
    margin-top: 0.6rem;
}

.auth-strength-bar-track {
    height: 5px;
    background: #e2e8f0;
    border-radius: 50px;
    overflow: hidden;
}

.auth-strength-bar-fill {
    height: 100%;
    border-radius: 50px;
    transition: width 0.35s ease, background-color 0.35s ease;
    width: 0%;
}

.auth-strength-bar-fill[data-strength="1"] { width: 25%; background: #ef4444; }
.auth-strength-bar-fill[data-strength="2"] { width: 50%; background: #f97316; }
.auth-strength-bar-fill[data-strength="3"] { width: 75%; background: #eab308; }
.auth-strength-bar-fill[data-strength="4"] { width: 100%; background: var(--accent-color, #419443); }

.auth-strength-text {
    font-size: 0.78rem;
    font-weight: 600;
    margin-top: 0.35rem;
    color: #9ca3af;
    transition: color 0.25s;
    min-height: 1.1rem;
}

/* ── Lock Screen Avatar ───────────────────────────────────── */
.auth-lock-avatar {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 1.75rem;
}

.auth-avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.6rem;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.02em;
    box-shadow: 0 4px 20px rgba(var(--primary-color-rgb), 0.30);
    margin-bottom: 0.85rem;
}

.auth-lock-name {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 0.2rem;
}

.auth-lock-email {
    font-size: 0.82rem;
    color: #9ca3af;
    margin: 0;
}

.auth-lock-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: rgba(var(--primary-color-rgb), 0.09);
    color: var(--primary-color);
    font-size: 1rem;
    margin-top: 0.5rem;
}

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 991px) {
    .auth-brand-panel {
        display: none;
    }

    .auth-mobile-logo {
        display: block;
    }

    .auth-form-panel {
        width: 100%;
        min-height: 100vh;
    }

    .auth-form-inner {
        padding: 2rem 1.5rem;
    }
}

@media (max-width: 480px) {
    .auth-form-inner {
        padding: 1.5rem 1rem;
    }

    .auth-form-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}
