/* ============================================================
   CareCompile Login v4.0 — Aligned with index.php v3.0
   ============================================================ */
:root {
    --bg:              #030712;
    --bg2:             #0a1628;
    --bg3:             #0d1525;
    --card:            rgba(13,21,37,0.85);
    --border:          rgba(255,255,255,0.07);
    --border-glow:     rgba(13,148,136,0.35);
    --teal:            #0d9488;
    --teal-light:      #14b8a6;
    --teal-dim:        rgba(13,148,136,0.12);
    --green:           #10b981;
    --red:             #ef4444;
    --orange:          #f97316;
    --text:            #f1f5f9;
    --text2:           #94a3b8;
    --text3:           #64748b;
    --radius:          12px;
}

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

html, body {
    height: 100%;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    background: var(--bg);
    color: var(--text);
    overflow-x: hidden;
}

/* ============================================================
   ANIMATIONS
   ============================================================ */
@keyframes fadeUp   { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn   { from { opacity: 0; } to { opacity: 1; } }
@keyframes pulse    { 0%, 100% { opacity: 1; } 50% { opacity: 0.3; } }
@keyframes spin     { to { transform: rotate(360deg); } }
@keyframes orb1     { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(50px, -35px); } }
@keyframes orb2     { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(-40px, 30px); } }
@keyframes orb3     { 0%, 100% { transform: translate(0, 0); } 50% { transform: translate(30px, 45px); } }
@keyframes slideIn  { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
@keyframes shake    { 0%, 100% { transform: translateX(0); } 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }

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

/* ============================================================
   LEFT — BRAND PANEL
   ============================================================ */
.brand-panel {
    position: relative;
    background: linear-gradient(160deg, #061a1a 0%, #091f2e 50%, #0a1628 100%);
    border-right: 1px solid rgba(13, 148, 136, 0.18);
    display: flex;
    flex-direction: column;
    padding: 44px 48px 40px;
    overflow: hidden;
}

/* Animated orbs */
.brand-orb {
    position: absolute;
    border-radius: 50%;
    pointer-events: none;
    filter: blur(60px);
}
.brand-orb-1 {
    width: 380px; height: 380px;
    top: -100px; left: -100px;
    background: radial-gradient(circle, rgba(13,148,136,0.22) 0%, transparent 70%);
    animation: orb1 14s ease-in-out infinite;
}
.brand-orb-2 {
    width: 260px; height: 260px;
    bottom: 80px; right: -80px;
    background: radial-gradient(circle, rgba(249,115,22,0.12) 0%, transparent 70%);
    animation: orb2 18s ease-in-out infinite;
}
.brand-orb-3 {
    width: 200px; height: 200px;
    bottom: -60px; left: 60px;
    background: radial-gradient(circle, rgba(59,130,246,0.1) 0%, transparent 70%);
    animation: orb3 22s ease-in-out infinite;
}

/* Subtle vertical separator line on right edge */
.brand-panel::after {
    content: '';
    position: absolute;
    top: 10%;
    right: 0;
    width: 1px;
    height: 80%;
    background: linear-gradient(to bottom, transparent, rgba(13,148,136,0.22) 30%, rgba(13,148,136,0.22) 70%, transparent);
    pointer-events: none;
}

.brand-logo {
    display: inline-flex;
    align-items: center;
    text-decoration: none;
    position: relative;
    z-index: 1;
}
.brand-logo img {
    height: 42px;
    width: auto;
}

/* Live indicator */
.brand-live {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 20px;
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--teal-light);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    position: relative;
    z-index: 1;
}
.brand-live-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 8px var(--green);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

.brand-content {
    position: relative;
    z-index: 1;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 40px 0 20px;
}

.brand-headline {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 2rem;
    font-weight: 800;
    color: var(--text);
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin-bottom: 14px;
}
.brand-headline span {
    background: linear-gradient(135deg, var(--teal-light) 0%, #38bdf8 60%, var(--teal) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.brand-description {
    font-size: 0.92rem;
    color: var(--text2);
    line-height: 1.75;
    margin-bottom: 36px;
    max-width: 340px;
}

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

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

.brand-feature-icon {
    width: 34px;
    height: 34px;
    border-radius: 9px;
    background: rgba(13, 148, 136, 0.12);
    border: 1px solid rgba(13, 148, 136, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    color: var(--teal-light);
}

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

.brand-trust {
    display: flex;
    flex-wrap: wrap;
    gap: 7px;
    padding-top: 28px;
    border-top: 1px solid rgba(255,255,255,0.05);
}
.brand-trust-badge {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 5px 11px;
    background: rgba(13, 148, 136, 0.07);
    border: 1px solid rgba(13, 148, 136, 0.18);
    border-radius: 100px;
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text2);
    letter-spacing: 0.03em;
}
.brand-trust-badge svg { color: var(--teal); }

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

/* Subtle dot grid — matches index.php hero-right */
.form-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255,255,255,0.022) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255,255,255,0.022) 1px, transparent 1px);
    background-size: 44px 44px;
    pointer-events: none;
}

/* Teal glow centered behind the form */
.form-panel::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(13,148,136,0.06) 0%, transparent 65%);
    pointer-events: none;
}

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

.login-container {
    width: 100%;
    max-width: 400px;
    position: relative;
    z-index: 1;
    animation: fadeUp 0.45s ease-out both;
}

/* Glass card */
#loginCard {
    background: rgba(10, 22, 40, 0.72);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid var(--border);
    border-radius: 20px;
    padding: 36px 32px 32px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.4), inset 0 1px 0 rgba(255,255,255,0.04);
    margin-bottom: 16px;
}

.login-title {
    font-family: 'Space Grotesk', sans-serif;
    font-size: 1.7rem;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 6px;
    letter-spacing: -0.02em;
}

.login-subtitle {
    color: var(--text2);
    font-size: 0.9rem;
    margin-bottom: 28px;
    line-height: 1.55;
}

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

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

.input-wrapper { position: relative; }

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

.form-input {
    width: 100%;
    padding: 13px 13px 13px 42px;
    font-size: 0.92rem;
    font-family: inherit;
    background: rgba(255,255,255,0.04);
    border: 1.5px solid var(--border);
    border-radius: 10px;
    color: var(--text);
    transition: all 0.2s;
}
.form-input:focus {
    outline: none;
    border-color: var(--teal-light);
    background: rgba(13,148,136,0.05);
    box-shadow: 0 0 0 4px rgba(13,148,136,0.1);
}
.form-input:focus ~ .input-icon { color: var(--teal-light); }
.form-input::placeholder { color: var(--text3); }
.form-input.error { border-color: var(--red); }
.form-input.error:focus { box-shadow: 0 0 0 4px rgba(239,68,68,0.1); }

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

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

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

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text2);
    user-select: none;
}
.remember-me input { display: none; }
.checkbox-custom {
    width: 17px;
    height: 17px;
    border: 1.5px solid var(--border);
    border-radius: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
    background: rgba(255,255,255,0.03);
}
.checkbox-custom svg { width: 10px; height: 10px; color: white; opacity: 0; transform: scale(0); transition: all 0.15s; }
.remember-me input:checked + .checkbox-custom { background: var(--teal-light); border-color: var(--teal-light); }
.remember-me input:checked + .checkbox-custom svg { opacity: 1; transform: scale(1); }

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

.submit-btn {
    width: 100%;
    padding: 14px;
    font-size: 0.93rem;
    font-weight: 600;
    font-family: inherit;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    color: white;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.25s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    position: relative;
    overflow: hidden;
    box-shadow: 0 0 24px rgba(13,148,136,0.25);
}
.submit-btn::before {
    content: '';
    position: absolute;
    top: 0; left: -100%;
    width: 100%; height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.1), 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 24px rgba(13,148,136,0.4);
}
.submit-btn:active:not(:disabled) { transform: translateY(0); }
.submit-btn:disabled { opacity: 0.55; cursor: not-allowed; }

.spinner {
    width: 17px; height: 17px;
    border: 2px solid rgba(255,255,255,0.3);
    border-top-color: white;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

/* ============================================================
   CARD FOOTER
   ============================================================ */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid var(--border);
    font-size: 0.75rem;
    color: var(--text3);
}
.security-note svg { color: var(--green); }

.footer-text {
    text-align: center;
    color: var(--text3);
    font-size: 0.8rem;
}
.footer-text a { color: var(--teal-light); text-decoration: none; font-weight: 500; }
.footer-text a:hover { color: var(--text); }

/* ============================================================
   SHAKE
   ============================================================ */
.shake { animation: shake 0.4s ease-in-out; }

/* ============================================================
   LANGUAGE SWITCHER
   ============================================================ */
.lang-toggle {
    display: flex; align-items: center; gap: 6px;
    padding: 6px 12px;
    background: rgba(255,255,255,0.04);
    backdrop-filter: blur(10px);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text2);
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.8rem;
    font-family: inherit;
}
.lang-toggle:hover { border-color: rgba(13,148,136,0.4); color: var(--text); }
.lang-toggle-code { font-weight: 600; letter-spacing: 0.05em; }
.lang-chevron { transition: transform 0.2s; opacity: 0.5; }
.lang-toggle[aria-expanded="true"] .lang-chevron { transform: rotate(180deg); }
.lang-dropdown {
    position: absolute; top: calc(100% + 6px); right: 0;
    background: #0d1525;
    border: 1px solid var(--border);
    border-radius: 10px; padding: 5px;
    min-width: 180px; display: none; z-index: 1000;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5); list-style: none;
}
.lang-dropdown.open { display: block; animation: slideIn 0.15s ease-out; }
.lang-dropdown li { list-style: none; }
.lang-dropdown a { display: flex; align-items: center; gap: 9px; padding: 8px 10px; color: var(--text2); text-decoration: none; transition: all 0.15s; border-radius: 7px; }
.lang-dropdown a:hover { background: rgba(13,148,136,0.08); color: var(--text); }
.lang-dropdown .active a { background: rgba(13,148,136,0.1); color: var(--teal-light); }
.lang-option-code { display: inline-flex; align-items: center; justify-content: center; width: 24px; height: 24px; background: rgba(255,255,255,0.05); border-radius: 5px; font-size: 0.65rem; font-weight: 700; letter-spacing: 0.05em; flex-shrink: 0; }
.lang-dropdown .active .lang-option-code { background: rgba(13,148,136,0.18); color: var(--teal-light); }
.lang-option-name { flex: 1; font-size: 0.85rem; font-weight: 500; }
.lang-check { flex-shrink: 0; color: var(--teal-light); }

/* ============================================================
   FORGOT PASSWORD — shared
   ============================================================ */
.card-icon {
    width: 52px; height: 52px;
    background: linear-gradient(135deg, var(--teal), var(--teal-light));
    border-radius: 14px;
    display: flex; align-items: center; justify-content: center;
    margin-bottom: 18px;
    color: white;
    box-shadow: 0 0 20px rgba(13,148,136,0.3);
}
.card-icon svg { width: 24px; height: 24px; }

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

.card-subtitle {
    color: var(--text2);
    font-size: 0.88rem;
    line-height: 1.6;
    margin-bottom: 22px;
}

.back-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 18px;
    font-size: 0.85rem;
    color: var(--text3);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s;
}
.back-link:hover { color: var(--teal-light); }

.success-state { text-align: center; }
.success-icon {
    width: 68px; height: 68px;
    background: rgba(16,185,129,0.12);
    border: 2px solid rgba(16,185,129,0.28);
    border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    margin: 0 auto 20px;
    color: var(--green);
    animation: fadeUp 0.4s ease-out;
}
.success-icon svg { width: 30px; height: 30px; }

.resend-text {
    margin-top: 14px;
    font-size: 0.8rem;
    color: var(--text3);
    text-align: center;
}
.resend-text a { color: var(--teal-light); text-decoration: none; font-weight: 500; }
.resend-text a:hover { text-decoration: underline; }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .login-page { grid-template-columns: 1fr; }
    .brand-panel {
        padding: 32px 28px 24px;
        border-right: none;
        border-bottom: 1px solid rgba(13,148,136,0.18);
        min-height: auto;
    }
    .brand-panel::after { display: none; }
    .brand-content { padding: 24px 0 8px; }
    .brand-features { display: none; }
    .brand-headline { font-size: 1.5rem; }
    .brand-description { display: none; }
    .form-panel { padding: 36px 24px; }
    .login-container { max-width: 100%; }
}

@media (max-width: 480px) {
    .brand-panel { padding: 24px 20px; }
    .brand-logo img { height: 42px; }
    .brand-trust { display: none; }
    .form-panel { padding: 28px 16px; }
    #loginCard { padding: 28px 20px 24px; }
    .form-row { flex-direction: column; align-items: flex-start; gap: 10px; }
}
