/* ===== ROOT VARIABLES ===== */
:root {
    --primary: #1d4ed8;
    --primary-light: #3b82f6;
    --primary-dark: #1e3a8a;
    --secondary: #f97316;
    --secondary-light: #fb923c;
    --success: #10b981;
    --danger: #ef4444;
    --warning: #f59e0b;

    --bg-main: #f0f4ff;
    --bg-white: #ffffff;
    --text-primary: #0f172a;
    --text-secondary: #475569;
    --text-muted: #94a3b8;
    --border: #e2e8f0;
    --border-focus: #3b82f6;

    --gradient-main: linear-gradient(135deg, #1d4ed8 0%, #7c3aed 55%, #f97316 100%);
    --gradient-blue: linear-gradient(135deg, #1d4ed8, #4f46e5);
    --shadow-sm: 0 2px 8px rgba(29,78,216,0.08);
    --shadow-md: 0 8px 30px rgba(29,78,216,0.12);
    --shadow-lg: 0 24px 80px rgba(29,78,216,0.18);
    --shadow-card: 0 8px 40px rgba(15,23,42,0.1);

    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 24px;
    --transition: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --font: 'Outfit', sans-serif;
}

/* ===== RESET ===== */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { font-size: 16px; height: 100%; }
body {
    font-family: var(--font);
    background: var(--bg-main);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    position: relative;
}
a { text-decoration: none; color: inherit; }
button { font-family: var(--font); cursor: pointer; border: none; outline: none; }
input { font-family: var(--font); }

/* ===== BACKGROUND BLOBS ===== */
.bg-blobs { position: fixed; inset: 0; z-index: 0; pointer-events: none; overflow: hidden; }
.blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
    opacity: 0.25;
    animation: blobFloat 10s ease-in-out infinite;
}
.blob-1 {
    width: 700px; height: 700px;
    background: radial-gradient(circle, #bfdbfe, transparent);
    top: -200px; left: -200px;
    animation-delay: 0s;
}
.blob-2 {
    width: 500px; height: 500px;
    background: radial-gradient(circle, #fed7aa, transparent);
    bottom: -100px; right: -100px;
    animation-delay: 3.5s;
}
.blob-3 {
    width: 400px; height: 400px;
    background: radial-gradient(circle, #ddd6fe, transparent);
    top: 40%; right: 30%;
    animation-delay: 6s;
}
@keyframes blobFloat {
    0%,100% { transform: translateY(0) scale(1); }
    50% { transform: translateY(-30px) scale(1.08); }
}

/* Particles */
.particles { position: fixed; inset: 0; z-index: 1; pointer-events: none; overflow: hidden; }
.particle {
    position: absolute;
    width: 4px; height: 4px;
    border-radius: 50%;
    background: rgba(29,78,216,0.15);
    animation: pFloat linear infinite;
}
@keyframes pFloat {
    0% { transform: translateY(100vh); opacity: 0; }
    10% { opacity: 1; }
    90% { opacity: 1; }
    100% { transform: translateY(-80px); opacity: 0; }
}

/* ===== LAYOUT ===== */
.login-layout {
    display: grid;
    grid-template-columns: 1.1fr 1fr;
    height: 100vh;
    position: relative;
    z-index: 2;
    overflow: hidden;
}

/* ===== LEFT PANEL ===== */
.left-panel {
    background: var(--gradient-blue);
    padding: 24px 32px;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    min-width: 0;
    word-break: break-word;
    overflow-wrap: break-word;
}
.left-panel::before {
    content: '';
    position: absolute;
    inset: 0;
    background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.04'%3E%3Ccircle cx='30' cy='30' r='2'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") repeat;
    z-index: 0;
}
.left-panel > * { position: relative; z-index: 1; }

/* Top glow circles */
.left-panel::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,0.08) 0%, transparent 70%);
    top: -150px; right: -100px;
    z-index: 0;
}

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1.3rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 24px;
    flex-shrink: 0;
    white-space: nowrap;
}
.logo-emoji { font-size: 1.8rem; }
.brand-accent {
    background: linear-gradient(135deg, #fbbf24, #fb923c);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.left-content { flex: 1; display: flex; flex-direction: column; justify-content: center; }

.left-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.25);
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.9);
    margin-bottom: 16px;
    width: fit-content;
    backdrop-filter: blur(10px);
}
.badge-ping {
    width: 8px; height: 8px;
    border-radius: 50%;
    background: #4ade80;
    animation: ping 2s ease infinite;
    flex-shrink: 0;
}
@keyframes ping { 0%,100%{box-shadow:0 0 0 0 rgba(74,222,128,0.5);} 50%{box-shadow:0 0 0 8px rgba(74,222,128,0);} }

.left-title {
    font-size: clamp(1.4rem, 2.5vw, 2.2rem);
    font-weight: 900;
    line-height: 1.2;
    color: #fff;
    margin-bottom: 10px;
    word-break: break-word;
}
.title-gradient {
    background: linear-gradient(135deg, #fbbf24, #fb923c, #f472b6);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}
.left-subtitle {
    font-size: 0.9rem;
    color: rgba(255,255,255,0.72);
    line-height: 1.6;
    margin-bottom: 20px;
    max-width: 100%;
    overflow-wrap: break-word;
}

.trust-items { display: flex; flex-direction: column; gap: 10px; margin-bottom: 20px; }
.trust-item {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    padding: 10px 14px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    backdrop-filter: blur(10px);
    transition: var(--transition);
    min-width: 0;
}
.trust-item:hover { background: rgba(255,255,255,0.15); transform: translateX(5px); }
.trust-icon { font-size: 1.2rem; flex-shrink: 0; }
.trust-title { font-size: 0.85rem; font-weight: 700; color: #fff; margin-bottom: 2px; }
.trust-desc { font-size: 0.72rem; color: rgba(255,255,255,0.6); overflow-wrap: break-word; }

.stat-row {
    display: flex;
    align-items: center;
    gap: 0;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: var(--radius-sm);
    padding: 10px 16px;
    backdrop-filter: blur(10px);
    margin-top: auto;
}
.mini-stat { display: flex; flex-direction: column; align-items: center; flex: 1; }
.mini-num { font-size: 1.3rem; font-weight: 900; color: #fff; line-height: 1.2; }
.mini-label { font-size: 0.7rem; color: rgba(255,255,255,0.6); font-weight: 600; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.5px; }
.mini-divider { width: 1px; height: 28px; background: rgba(255,255,255,0.2); }

/* Floating review */
.review-float {
    margin-top: auto;
    padding-top: 24px;
    display: flex;
    align-items: center;
    gap: 14px;
    background: rgba(255,255,255,0.12);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: var(--radius-sm);
    padding: 14px 18px;
    backdrop-filter: blur(10px);
    animation: floatCard 5s ease-in-out infinite;
    flex-shrink: 0;
}
@keyframes floatCard { 0%,100%{transform:translateY(0);} 50%{transform:translateY(-6px);} }
.review-avatar {
    width: 42px; height: 42px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-weight: 800; font-size: 1.1rem; color: #fff; flex-shrink: 0;
}
.review-quote { font-size: 0.85rem; font-weight: 600; color: #fff; margin-bottom: 2px; }
.review-author { font-size: 0.72rem; color: rgba(255,255,255,0.65); }
.review-stars { font-size: 0.7rem; flex-shrink: 0; }

/* ===== RIGHT PANEL ===== */
.right-panel {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 20px 40px;
    position: relative;
    min-width: 0;
    overflow-y: auto;
    height: 100vh;
    background: #f8faff;
}

.form-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-white);
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(29,78,216,0.13), 0 1px 4px rgba(0,0,0,0.06);
    border: 1px solid var(--border);
    padding: 20px 24px 16px;
    position: relative;
    overflow: hidden;
    margin-top: auto;
    margin-bottom: auto;
}
.form-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 4px;
    background: var(--gradient-main);
}

/* ===== TABS ===== */
.form-tabs {
    display: flex;
    background: #f1f5f9;
    border-radius: 10px;
    padding: 4px;
    margin-bottom: 12px;
    position: relative;
}
.tab {
    flex: 1;
    padding: 10px 20px;
    border-radius: 8px;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--text-muted);
    background: none;
    transition: var(--transition);
    position: relative;
    z-index: 1;
}
.tab.active { color: var(--text-primary); }
.tab-slider {
    position: absolute;
    top: 4px; left: 4px;
    width: calc(50% - 4px);
    height: calc(100% - 8px);
    background: #fff;
    border-radius: 8px;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition);
    z-index: 0;
}
.tab-slider.right { transform: translateX(100%); }

.form-welcome { margin-bottom: 10px; }
.form-welcome h2 { font-size: 1.3rem; font-weight: 800; color: var(--text-primary); margin-bottom: 2px; }
.form-welcome p { font-size: 0.8rem; color: var(--text-muted); }

/* ===== SOCIAL AUTH ===== */
.social-auth { margin-bottom: 8px; }
.social-btn-google {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 9px 20px;
    border-radius: var(--radius-sm);
    border: 1.5px solid var(--border);
    background: var(--bg-white);
    color: var(--text-primary);
    font-weight: 700;
    font-size: 0.88rem;
    transition: var(--transition);
}
.social-btn-google:hover { border-color: var(--primary-light); background: #eff6ff; transform: translateY(-2px); box-shadow: var(--shadow-md); }

/* ===== DIVIDER ===== */
.divider-row { display: flex; align-items: center; gap: 14px; margin-bottom: 10px; }
.divider-line { flex: 1; height: 1px; background: var(--border); }
.divider-text { font-size: 0.78rem; color: var(--text-muted); font-weight: 600; white-space: nowrap; }

/* ===== FORM FIELDS ===== */
.field-group { margin-bottom: 8px; }
.field-group label {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.label-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 4px; }
.label-row label { margin-bottom: 0; }
.forgot-link { font-size: 0.78rem; color: var(--primary); font-weight: 600; transition: var(--transition); }
.forgot-link:hover { color: var(--secondary); }

.input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.input-icon {
    position: absolute;
    left: 14px;
    font-size: 1rem;
    pointer-events: none;
    z-index: 1;
}
.input-wrap input {
    width: 100%;
    padding: 10px 40px 10px 40px;
    background: #f8faff;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-size: 0.9rem;
    transition: var(--transition);
    outline: none;
}
.input-wrap input:focus {
    border-color: var(--primary-light);
    background: #eff6ff;
    box-shadow: 0 0 0 3px rgba(59,130,246,0.15);
}
.input-wrap input::placeholder { color: var(--text-muted); }
.toggle-pass {
    position: absolute;
    right: 14px;
    background: none;
    color: var(--text-muted);
    padding: 4px;
    transition: var(--transition);
}
.toggle-pass:hover { color: var(--primary); }

/* ===== REMEMBER ME ===== */
.remember-row { margin-bottom: 10px; }
.checkbox-label {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
    user-select: none;
}
.checkbox-label input[type="checkbox"] { display: none; }
.checkmark {
    width: 18px; height: 18px; flex-shrink: 0;
    border-radius: 5px;
    border: 2px solid var(--border);
    display: flex; align-items: center; justify-content: center;
    transition: var(--transition);
    background: var(--bg-white);
}
.checkbox-label input:checked + .checkmark {
    background: var(--primary);
    border-color: var(--primary);
}
.checkbox-label input:checked + .checkmark::after {
    content: '✓';
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
}
.terms-label { margin-top: -6px; margin-bottom: 20px; }
.terms-label a { color: var(--primary); font-weight: 600; }

/* ===== PASSWORD STRENGTH ===== */
.strength-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    margin-top: 4px;
    overflow: hidden;
}
.strength-fill {
    height: 100%;
    border-radius: 2px;
    transition: width 0.4s ease, background 0.4s ease;
    width: 0;
}
.strength-label { font-size: 0.72rem; font-weight: 600; margin-top: 2px; }

/* ===== SUBMIT BUTTON ===== */
.btn-submit {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 10px 20px;
    border-radius: var(--radius-sm);
    background: var(--gradient-blue);
    color: #fff;
    font-weight: 700;
    font-size: 0.92rem;
    transition: var(--transition);
    box-shadow: 0 4px 12px rgba(29,78,216,0.25);
    margin-bottom: 8px;
    position: relative;
    overflow: hidden;
}
.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255,255,255,0.1);
    opacity: 0;
    transition: var(--transition);
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 12px 35px rgba(29,78,216,0.45); }
.btn-submit:hover::before { opacity: 1; }
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled { opacity: 0.7; cursor: not-allowed; transform: none; }

/* ===== SWITCH TEXT ===== */
.switch-text { text-align: center; font-size: 0.85rem; color: var(--text-muted); }
.switch-text a { color: var(--primary); font-weight: 700; transition: var(--transition); }
.switch-text a:hover { color: var(--secondary); }

/* ===== FORM ROW ===== */
.form-row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

/* ===== FORGOT PANEL ===== */
.back-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    border-radius: 8px;
    background: #eff6ff;
    color: var(--primary);
    font-weight: 700;
    font-size: 0.85rem;
    transition: var(--transition);
}
.back-btn:hover { background: #dbeafe; transform: translateX(-3px); }

/* ===== SECURITY NOTE ===== */
.security-note {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid var(--border);
}
.security-note p { font-size: 0.78rem; color: var(--text-muted); font-weight: 500; }

/* ===== BACK HOME ===== */
.back-home {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-muted);
    transition: var(--transition);
    padding: 4px 10px;
    border-radius: 8px;
}
.back-home:hover { color: var(--primary); background: #eff6ff; }

/* ===== TOAST ===== */
.toast {
    position: fixed;
    top: 24px; right: 24px;
    transform: translateX(calc(100% + 48px)); /* fully off-screen right */
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--bg-white);
    border: 1.5px solid #a7f3d0;
    color: var(--text-primary);
    padding: 14px 22px;
    border-radius: 12px;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 9999;
    transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
    box-shadow: var(--shadow-lg);
    width: max-content;
    max-width: min(320px, calc(100% - 48px));
    pointer-events: none;
}
.toast.show { transform: translateX(0); pointer-events: auto; }
.toast.error { border-color: #fca5a5; }
#toastIcon { font-size: 1.3rem; }

/* ===== RESPONSIVE ===== */
@media (max-width: 1024px) {
    .login-layout { grid-template-columns: 1fr 1.1fr; }
    .left-panel { padding: 36px 36px; }
}

@media (max-width: 900px) {
    .login-layout { grid-template-columns: 1fr; height: auto; overflow: auto; }
    .left-panel { display: none; }
    .right-panel {
        padding: 40px 24px;
        height: auto;
        min-height: 100vh;
        background: #f8faff;
    }
    .form-card { padding: 32px 24px 28px; }
}

@media (max-width: 480px) {
    .form-row-two { grid-template-columns: 1fr; }
    .form-card { padding: 28px 20px 24px; border-radius: var(--radius); }
}
