/* ============================================================
   CareCompile Login — Split Layout v3.0
   ============================================================ */
:root {
    --bg-primary: #030712;
    --bg-secondary: #111827;
    --bg-card: #0f172a;
    --bg-glass: rgba(17, 24, 39, 0.5);
    --border-color: rgba(255, 255, 255, 0.08);
    --text-primary: #f9fafb;
    --text-secondary: #9ca3af;
    --text-muted: #6b7280;
    --accent-primary: #0d9488;
    --accent-primary-light: #14b8a6;
    --accent-primary-glow: rgba(13, 148, 136, 0.5);
    --accent-coral: #e07a5f;
    --status-success: #10b981;
    --status-critical: #ef4444;
    --status-warning: #f59e0b;
}

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

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg-primary);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ============================================================
   SPLIT LAYOUT
   ============================================================ */
.login-page {
    display: grid;
    grid-template-columns: 480px 1fr;
    min-height: 100vh;
}

/* ============================================================
   LEFT — BRAND PANEL
   ============================================================ */
.brand-panel {
    position: relative;
    background: linear-gradient(160deg, #0a2323 0%, #0d2f2f 40%, #0f1f2e 100%);
    border-right: 1px solid rgba(13, 148, 136, 0.2);
    display: flex;
    flex-direction: column;
    padding: 48px 48px 40px;
    overflow: hidden;
}

/* Decorative orbs */
.brand-panel::before {
    content: '';
    position: absolute;
    top: -80px;
    left: -80px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(13, 148, 136, 0.2) 0%, transparent 70%);
    pointer-events: none;
}
.brand-panel::after {
    content: '';
    position: absolute;
    bottom: -60px;
    right: -60px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, rgba(224, 122, 95, 0.12) 0%, transparent 70%);
    pointer-events: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    margin-bottom: auto;
}
.brand-logo img {
    height: 64px;
    width: auto;
}

.brand-content {
    position: relative;
    z-index: 1;
    margin: auto 0;
    padding: 48px 0;
}

.brand-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.25;
    margin-bottom: 16px;
}

.brand-headline span {
    background: linear-gradient(135deg, var(--accent-primary-light), #34d399);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-description {
    font-size: 1rem;
    color: var(--text-secondary);
    line-height: 1.7;
    margin-bottom: 40px;
}

.brand-features {
    display: flex;
    flex-direction: column;
    gap: 16px;
    margin-bottom: 40px;
}

.brand-feature {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.brand-feature-icon {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    background: rgba(13, 148, 136, 0.15);
    border: 1px solid rgba(13, 148, 136, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--accent-primary-light);
}

.brand-feature-text strong {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 2px;
}
.brand-feature-text span {
    font-size: 0.82rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.brand-stats {
    display: flex;
    gap: 24px;
    padding: 20px 0;
    border-top: 1px solid rgba(255,255,255,0.06);
    border-bottom: 1px solid rgba(255,255,255,0.06);
    margin-bottom: 32px;
}

.brand-stat {
    text-align: left;
}
.brand-stat-value {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--accent-primary-light);
    line-height: 1;
    margin-bottom: 4px;
}
.brand-stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.brand-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}
.brand-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: rgba(13, 148, 136, 0.08);
    border: 1px solid rgba(13, 148, 136, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-secondary);
    white-space: nowrap;
}
.brand-trust-badge svg { color: var(--accent-primary); }

/* ============================================================
   RIGHT — FORM PANEL
   ============================================================ */
.form-panel {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 48px 40px;
    background: var(--bg-primary);
    position: relative;
}

.lang-switcher {
    position: absolute;
    top: 20px;
    right: 20px;
    z-index: 10;
}

.login-container {
    width: 100%;
    max-width: 400px;
    animation: fadeInUp 0.45s ease-out;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(16px); }
    to   { opacity: 1; transform: translateY(0); }
}

.login-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.login-subtitle {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 32px;
    line-height: 1.5;
}

/* ============================================================
   FORM ELEMENTS
   ============================================================ */
.form-group { margin-bottom: 20px; }

.form-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.input-wrapper { position: relative; }

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    pointer-events: none;
    transition: color 0.2s;
}

.form-input {
    width: 100%;
    padding: 14px 14px 14px 44px;
    font-size: 0.95rem;
    font-family: inherit;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border-color);
    border-radius: 12px;
    color: var(--text-primary);
    transition: all 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--accent-primary-light);
    background: rgba(13, 148, 136, 0.04);
    box-shadow: 0 0 0 4px rgba(13, 148, 136, 0.12);
}
.form-input:focus ~ .input-icon { color: var(--accent-primary-light); }
.form-input::placeholder { color: var(--text-muted); }
.form-input.error { border-color: var(--status-critical); }
.form-input.error:focus { box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12); }

.password-wrapper .form-input { padding-right: 48px; }

.password-toggle {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    color: var(--text-muted);
    transition: color 0.2s;
}
.password-toggle:hover { color: var(--text-secondary); }
.password-toggle svg { width: 20px; height: 20px; }

.form-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 9px;
    cursor: pointer;
    font-size: 0.875rem;
    color: var(--text-secondary);
    user-select: none;
}
.remember-me input { display: none; }
.checkbox-custom {
    width: 18px;
    height: 18px;
    border: 1.5px solid var(--border-color);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}
.checkbox-custom svg { width: 11px; height: 11px; color: white; opacity: 0; transform: scale(0); transition: all 0.2s; }
.remember-me input:checked + .checkbox-custom { background: var(--accent-primary-light); border-color: var(--accent-primary-light); }
.remember-me input:checked + .checkbox-custom svg { opacity: 1; transform: scale(1); }

.forgot-link {
    font-size: 0.875rem;
    color: var(--accent-primary-light);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.forgot-link:hover { color: var(--text-primary); }

.submit-btn {
    width: 100%;
    padding: 15px;
    font-size: 0.95rem;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-light));
    color: white;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: relative;
    overflow: hidden;
}
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.12), transparent);
    transition: left 0.5s;
}
.submit-btn:hover:not(:disabled)::before { left: 100%; }
.submit-btn:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 6px 20px var(--accent-primary-glow); }
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.6; cursor: not-allowed; }

.spinner {
    width: 18px; height: 18px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ============================================================
   ALERTS
   ============================================================ */
.alert {
    padding: 13px 16px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 0.875rem;
    display: flex;
    align-items: flex-start;
    gap: 10px;
    animation: slideIn 0.25s ease-out;
}
@keyframes slideIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: translateY(0); } }
.alert svg { flex-shrink: 0; margin-top: 1px; }
.alert-error  { background: rgba(239, 68, 68, 0.12); border: 1px solid rgba(239, 68, 68, 0.25); color: #fca5a5; }
.alert-success{ background: rgba(16, 185, 129, 0.12); border: 1px solid rgba(16, 185, 129, 0.25); color: #6ee7b7; }
.alert-warning{ background: rgba(245, 158, 11, 0.12); border: 1px solid rgba(245, 158, 11, 0.25); color: #fcd34d; }
.countdown { font-weight: 600; font-variant-numeric: tabular-nums; }

/* ============================================================
   FOOTER
   ============================================================ */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid var(--border-color);
    font-size: 0.78rem;
    color: var(--text-muted);
}
.security-note svg { color: var(--status-success); }

.footer-text {
    text-align: center;
    margin-top: 24px;
    color: var(--text-muted);
    font-size: 0.82rem;
}
.footer-text a { color: var(--accent-primary-light); text-decoration: none; font-weight: 500; }
.footer-text a:hover { text-decoration: underline; }

/* ============================================================
   SHAKE ANIMATION
   ============================================================ */
.shake { animation: shake 0.45s ease-in-out; }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    15%, 45%, 75% { transform: translateX(-5px); }
    30%, 60%, 90% { transform: translateX(5px); }
}

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-toggle {
    display: flex; align-items: center; gap: 7px;
    padding: 7px 13px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    color: var(--text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.82rem;
    font-family: inherit;
}
.lang-toggle:hover { border-color: var(--accent-primary); color: var(--text-primary); }
.lang-toggle-code { font-weight: 600; letter-spacing: 0.05em; }
.lang-chevron { transition: transform 0.2s; opacity: 0.6; }
.lang-toggle[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; top: calc(100% + 8px); right: 0;
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: 12px; padding: 6px;
    min-width: 190px; display: none; z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.4); list-style: none;
}
.lang-dropdown.open { display: block; animation: langDropIn 0.15s ease-out; }
@keyframes langDropIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: translateY(0); } }
.lang-dropdown li { list-style: none; }
.lang-dropdown a { display: flex; align-items: center; gap: 10px; padding: 9px 12px; color: var(--text-secondary); text-decoration: none; transition: all 0.15s; border-radius: 8px; }
.lang-dropdown a:hover { background: rgba(13,148,136,0.1); color: var(--text-primary); }
.lang-dropdown .active a { background: rgba(13,148,136,0.12); color: var(--accent-primary-light); }
.lang-option-code { display: inline-flex; align-items: center; justify-content: center; width: 26px; height: 26px; background: rgba(255,255,255,0.06); border-radius: 6px; font-size: 0.68rem; font-weight: 700; letter-spacing: 0.05em; flex-shrink: 0; }
.lang-dropdown .active .lang-option-code { background: rgba(13,148,136,0.2); color: var(--accent-primary-light); }
.lang-option-name { flex: 1; font-size: 0.875rem; font-weight: 500; }
.lang-check { flex-shrink: 0; color: var(--accent-primary-light); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 900px) {
    .login-page { grid-template-columns: 1fr; }
    .brand-panel {
        padding: 32px 28px 28px;
        border-right: none;
        border-bottom: 1px solid rgba(13,148,136,0.2);
    }
    .brand-content { padding: 28px 0; }
    .brand-features { display: none; }
    .brand-headline { font-size: 1.4rem; }
    .brand-description { display: none; }
    .brand-stats { gap: 20px; }
    .form-panel { padding: 40px 24px; }
    .login-container { max-width: 100%; }
}

@media (max-width: 480px) {
    .brand-panel { padding: 24px 20px; }
    .brand-logo img { height: 48px; }
    .brand-stats { display: none; }
    .form-panel { padding: 32px 20px; }
    .form-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}


/* ============================================================
   FORGOT PASSWORD — shared via login.css
   ============================================================ */
.card-icon {
    width: 56px;
    height: 56px;
    background: linear-gradient(135deg, var(--accent-primary), var(--accent-primary-light));
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 20px;
    color: white;
}
.card-icon svg { width: 26px; height: 26px; }

.card-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
}

.card-subtitle {
    color: var(--text-secondary);
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 24px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 20px;
    font-size: 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link:hover { color: var(--accent-primary-light); }

.success-state { text-align: center; }

.success-icon {
    width: 72px;
    height: 72px;
    background: rgba(16, 185, 129, 0.15);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    color: var(--status-success);
    animation: fadeInUp 0.4s ease-out;
}
.success-icon svg { width: 32px; height: 32px; }

.resend-text {
    margin-top: 16px;
    font-size: 0.82rem;
    color: var(--text-muted);
    text-align: center;
}
.resend-text a { color: var(--accent-primary-light); text-decoration: none; font-weight: 500; }
.resend-text a:hover { text-decoration: underline; }
