/* ============================================================
   LOGIN.CSS – SPM-KP RSUD Sehat Sejahtera
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
    --blue-600:  #2563eb;
    --blue-700:  #1d4ed8;
    --blue-50:   #eff6ff;
    --gray-50:   #f8fafc;
    --gray-100:  #f1f5f9;
    --gray-200:  #e2e8f0;
    --gray-400:  #94a3b8;
    --gray-500:  #64748b;
    --gray-700:  #334155;
    --gray-900:  #0f172a;
    --amber-100: #fef3c7;
    --amber-700: #b45309;
    --red-100:   #fee2e2;
    --red-600:   #dc2626;
    --white:     #ffffff;
    --radius-sm: 8px;
    --radius-md: 12px;
    --radius-lg: 16px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.10), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.10);
    --shadow-lg: 0 12px 40px rgba(0,0,0,.14);
    --trans:     .2s ease;
}

html, body {
    height: 100%;
    font-family: 'Inter', system-ui, sans-serif;
    font-size: 14px;
    color: var(--gray-700);
    background: var(--gray-100);
}

body {
    display: flex;
    min-height: 100vh;
}

/* ===================== HERO PANEL (kiri) ===================== */
.hero-panel {
    flex: 0 0 48%;
    position: relative;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        135deg,
        rgba(10, 25, 60, .82) 0%,
        rgba(15, 40, 100, .70) 60%,
        rgba(30, 60, 140, .60) 100%
    );
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 32px 40px;
    color: var(--white);
}

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-icon {
    width: 38px; height: 38px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255,255,255,.25);
    border-radius: var(--radius-sm);
    display: grid;
    place-items: center;
    color: #93c5fd;
    flex-shrink: 0;
}

.brand-text {
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .04em;
    color: rgba(255,255,255,.90);
}

/* Body */
.hero-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 18px;
}

.hero-body h1 {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.25;
    text-shadow: 0 2px 8px rgba(0,0,0,.3);
}

.hero-body h1 span {
    color: #93c5fd;
}

.hero-body p {
    font-size: 14px;
    line-height: 1.7;
    color: rgba(255,255,255,.80);
    max-width: 380px;
}

/* Stats */
.hero-stats {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-top: 8px;
}

.stat-item { text-align: center; }

.stat-num {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #93c5fd;
}

.stat-label {
    display: block;
    font-size: 11px;
    color: rgba(255,255,255,.65);
    margin-top: 2px;
    white-space: nowrap;
}

.stat-divider {
    width: 1px;
    height: 36px;
    background: rgba(255,255,255,.20);
}

/* Footer */
.hero-footer {
    font-size: 12px;
    color: rgba(255,255,255,.50);
}

/* ===================== LOGIN PANEL (kanan) ===================== */
.login-panel {
    flex: 1;
    background: var(--gray-50);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 32px 24px;
}

.login-card {
    width: 100%;
    max-width: 420px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

/* Shield icon */
.login-icon {
    width: 64px; height: 64px;
    background: var(--white);
    border: 1.5px solid var(--blue-600);
    border-radius: var(--radius-lg);
    display: grid;
    place-items: center;
    box-shadow: 0 0 0 6px rgba(37,99,235,.08);
    margin-bottom: 18px;
    transition: box-shadow var(--trans);
}

.login-icon:hover {
    box-shadow: 0 0 0 10px rgba(37,99,235,.12);
}

.login-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--gray-900);
    text-align: center;
    line-height: 1.35;
    margin-bottom: 6px;
}

.login-subtitle {
    font-size: 13px;
    color: var(--gray-500);
    text-align: center;
    margin-bottom: 28px;
}

/* ---- Form ---- */
form {
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 18px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.form-group label {
    font-size: 13px;
    font-weight: 500;
    color: var(--gray-700);
}

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.input-icon {
    position: absolute;
    left: 12px;
    color: var(--gray-400);
    display: flex;
    pointer-events: none;
}

.input-wrap input {
    width: 100%;
    height: 44px;
    padding: 0 42px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    font-family: inherit;
    font-size: 13.5px;
    color: var(--gray-900);
    outline: none;
    transition: border-color var(--trans), box-shadow var(--trans);
}

.input-wrap input::placeholder { color: var(--gray-400); }

.input-wrap input:focus {
    border-color: var(--blue-600);
    box-shadow: 0 0 0 3px rgba(37,99,235,.12);
}

.toggle-pw {
    position: absolute;
    right: 10px;
    background: none;
    border: none;
    cursor: pointer;
    color: var(--gray-400);
    display: flex;
    padding: 4px;
    border-radius: 4px;
    transition: color var(--trans);
}

.toggle-pw:hover { color: var(--gray-700); }

.forgot-wrap {
    display: flex;
    justify-content: flex-end;
    margin-top: 4px;
}

.forgot-link {
    font-size: 12.5px;
    color: var(--blue-600);
    text-decoration: none;
    font-weight: 500;
    transition: color var(--trans);
}

.forgot-link:hover { color: var(--blue-700); text-decoration: underline; }

/* ---- Button ---- */
.btn-login {
    width: 100%;
    height: 46px;
    background: var(--blue-600);
    color: var(--white);
    border: none;
    border-radius: var(--radius-sm);
    font-family: inherit;
    font-size: 14.5px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background var(--trans), transform .15s, box-shadow var(--trans);
    box-shadow: 0 2px 8px rgba(37,99,235,.30);
    margin-top: 4px;
}

.btn-login:hover:not(:disabled) {
    background: var(--blue-700);
    transform: translateY(-1px);
    box-shadow: 0 4px 16px rgba(37,99,235,.38);
}

.btn-login:active:not(:disabled) { transform: translateY(0); }

.btn-login:disabled {
    opacity: .72;
    cursor: not-allowed;
}

/* Spinner animation */
.btn-spinner svg {
    animation: spin .8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Alert error ---- */
.alert-error {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 11px 14px;
    background: var(--red-100);
    border: 1px solid #fca5a5;
    border-radius: var(--radius-sm);
    color: var(--red-600);
    font-size: 13px;
    line-height: 1.5;
    margin-bottom: 4px;
}

.alert-error svg { flex-shrink: 0; margin-top: 1px; }

/* ---- Warning box ---- */
.warning-box {
    width: 100%;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 12px 14px;
    background: var(--amber-100);
    border: 1px solid #fcd34d;
    border-radius: var(--radius-sm);
    margin-top: 18px;
}

.warning-box p {
    font-size: 12.5px;
    color: var(--amber-700);
    line-height: 1.55;
}

.warning-box svg { flex-shrink: 0; margin-top: 1px; }

/* ---- Login footer ---- */
.login-footer {
    margin-top: 22px;
    text-align: center;
}

.login-footer p {
    font-size: 11.5px;
    color: var(--gray-400);
    line-height: 1.6;
}

/* ===================== RESPONSIVE ===================== */
@media (max-width: 900px) {
    body { flex-direction: column; }

    .hero-panel {
        flex: 0 0 auto;
        min-height: 220px;
    }

    .hero-body h1 { font-size: 22px; }

    .hero-stats { display: none; }

    .login-panel { padding: 32px 16px; }
}

@media (max-width: 480px) {
    .login-card { max-width: 100%; }
}
