@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&display=swap');

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

:root {
    --emerald-50: #ecfdf5;
    --emerald-100: #d1fae5;
    --emerald-200: #a7f3d0;
    --emerald-400: #34d399;
    --emerald-500: #10b981;
    --emerald-600: #059669;
    --emerald-700: #047857;
    --slate-50: #f8fafc;
    --slate-100: #f1f5f9;
    --slate-200: #e2e8f0;
    --slate-300: #cbd5e1;
    --slate-400: #94a3b8;
    --slate-500: #64748b;
    --slate-600: #475569;
    --slate-700: #334155;
    --slate-800: #1e293b;
    --slate-900: #0f172a;
    --radius: 14px;
    --shadow-sm: 0 1px 3px rgba(0,0,0,.04), 0 1px 2px rgba(0,0,0,.06);
    --shadow-md: 0 4px 16px rgba(0,0,0,.06);
    --shadow-xl: 0 20px 50px rgba(0,0,0,.08);
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    height: 100vh;
    display: flex;
    background: var(--slate-50);
    color: var(--slate-800);
    -webkit-font-smoothing: antialiased;
    overflow: hidden;
}

/* ── LEFT PANEL ────────────── */
.login-panel-left {
    flex: 0 0 52%;
    background: linear-gradient(160deg, var(--emerald-700) 0%, var(--emerald-500) 50%, var(--emerald-400) 100%);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    position: relative;
    overflow: hidden;
}

/* decorative shapes */
.login-panel-left::before {
    content: '';
    position: absolute;
    width: 600px; height: 600px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.08), transparent 70%);
    top: -200px; right: -200px;
}
.login-panel-left::after {
    content: '';
    position: absolute;
    width: 400px; height: 400px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(255,255,255,.06), transparent 70%);
    bottom: -120px; left: -100px;
}

.brand-block {
    position: relative;
    z-index: 2;
    text-align: center;
    color: #fff;
}

.brand-logo {
    max-width: 220px;
    height: auto;
    margin-bottom: 18px;
    border-radius: 8px;
}

.brand-block h1 {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: -.5px;
    margin-bottom: 6px;
}

.brand-block p {
    font-size: .95rem;
    opacity: .88;
    line-height: 1.6;
    max-width: 340px;
}

/* feature highlights */
.features {
    position: relative;
    z-index: 2;
    margin-top: 28px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 14px;
    color: rgba(255,255,255,.9);
    font-size: .88rem;
    font-weight: 500;
}

.feature-icon {
    width: 40px; height: 40px;
    border-radius: 12px;
    background: rgba(255,255,255,.15);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    flex-shrink: 0;
}

/* ── RIGHT PANEL (FORM) ───── */
.login-panel-right {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 36px;
    overflow-y: auto;
}

.login-form-wrapper {
    width: 100%;
    max-width: 400px;
    animation: fadeIn .5s ease-out;
}

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

.login-greeting {
    margin-bottom: 24px;
}
.login-greeting h2 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--slate-900);
    margin-bottom: 6px;
}
.login-greeting p {
    font-size: .9rem;
    color: var(--slate-500);
}

/* form fields */
.field { margin-bottom: 16px; }

.field-label {
    display: block;
    font-size: .8rem;
    font-weight: 600;
    color: var(--slate-600);
    text-transform: uppercase;
    letter-spacing: .6px;
    margin-bottom: 8px;
}

.field-input-wrap {
    position: relative;
}

.field-input-wrap .fi {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 1.05rem;
    color: var(--slate-400);
    transition: color .2s;
    pointer-events: none;
}

.field-input {
    width: 100%;
    height: 48px;
    padding: 0 14px 0 44px;
    border: 1.5px solid var(--slate-200);
    border-radius: var(--radius);
    font-size: .92rem;
    font-family: inherit;
    color: var(--slate-800);
    background: #fff;
    transition: border-color .2s, box-shadow .2s;
}
.field-input::placeholder { color: var(--slate-400); }
.field-input:focus {
    outline: none;
    border-color: var(--emerald-500);
    box-shadow: 0 0 0 3px rgba(16,185,129,.12);
}
.field-input:focus + .fi,
.field-input:focus ~ .fi { color: var(--emerald-500); }

.toggle-pw {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--slate-400);
    cursor: pointer;
    font-size: 1.1rem;
    padding: 0;
    transition: color .2s;
}
.toggle-pw:hover { color: var(--slate-600); }

/* remember + forgot */
.field-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 20px;
}

.check-wrap {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
}
.check-wrap input[type="checkbox"] {
    width: 18px; height: 18px;
    accent-color: var(--emerald-500);
    cursor: pointer;
    border-radius: 4px;
}
.check-wrap span {
    font-size: .85rem;
    color: var(--slate-600);
    user-select: none;
}

.forgot-link {
    font-size: .85rem;
    color: var(--emerald-600, #059669);
    text-decoration: none;
    font-weight: 500;
    transition: color .2s;
}
.forgot-link:hover {
    color: var(--emerald-700, #047857);
    text-decoration: underline;
}

/* submit */
.btn-submit {
    width: 100%;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: var(--emerald-500);
    color: #fff;
    border: none;
    border-radius: var(--radius);
    font-size: .95rem;
    font-weight: 600;
    font-family: inherit;
    cursor: pointer;
    transition: background .2s, transform .15s, box-shadow .2s;
    box-shadow: 0 2px 8px rgba(16,185,129,.25);
}
.btn-submit:hover {
    background: var(--emerald-600);
    box-shadow: 0 4px 16px rgba(16,185,129,.3);
    transform: translateY(-1px);
}
.btn-submit:active { transform: translateY(0); }

/* separator */
.sep {
    display: flex;
    align-items: center;
    gap: 14px;
    margin: 18px 0;
    color: var(--slate-400);
    font-size: .78rem;
    text-transform: uppercase;
    letter-spacing: .5px;
}
.sep::before, .sep::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--slate-200);
}

/* register CTA */
.register-cta {
    text-align: center;
}

.register-cta p {
    font-size: .88rem;
    color: var(--slate-500);
    margin-bottom: 10px;
}

.btn-outline {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 22px;
    border: 1.5px solid var(--emerald-500);
    border-radius: var(--radius);
    font-size: .88rem;
    font-weight: 600;
    color: var(--emerald-600);
    text-decoration: none;
    font-family: inherit;
    transition: all .2s;
}
.btn-outline:hover {
    background: var(--emerald-500);
    color: #fff;
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}

/* back link */
.back-link {
    text-align: center;
    margin-top: 14px;
}
.back-link a {
    font-size: .84rem;
    color: var(--slate-400);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 4px;
    transition: color .2s;
}
.back-link a:hover { color: var(--emerald-500); }

/* error alert */
.form-error {
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 10px;
    padding: 12px 16px;
    margin-bottom: 16px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: .85rem;
    color: #b91c1c;
}
.form-error i { font-size: 1.1rem; flex-shrink: 0; }

/* ── RESPONSIVE ───────────── */
@media (max-width: 992px) {
    .login-panel-left { flex: 0 0 44%; padding: 40px; }
    .brand-block h1 { font-size: 1.6rem; }
}

@media (max-width: 768px) {
    body { flex-direction: column; }
    .login-panel-left {
        flex: none;
        padding: 36px 28px;
    }
    .features { display: none; }
    .brand-logo { width: 52px; height: 52px; margin-bottom: 16px; }
    .brand-block h1 { font-size: 1.35rem; }
    .brand-block p { font-size: .85rem; }
    .login-panel-right { padding: 28px 20px; }
}

/* SweetAlert overrides */
.swal2-popup { border-radius: 16px !important; }
.swal2-confirm { background: var(--emerald-500) !important; border-radius: 8px !important; }
