﻿
:root {
    --bg: #f0f4f8;
    --bg-card: #ffffff;
    --fg: #1e293b;
    --fg-muted: #64748b;
    --fg-dim: #94a3b8;
    --accent: #2563eb;
    --accent-hover: #1d4ed8;
    --accent-light: #eff6ff;
    --accent-glow: rgba(37, 99, 235, 0.15);
    --input-bg: #f8fafc;
    --input-border: #e2e8f0;
    --input-border-focus: #2563eb;
    --danger: #ef4444;
    --border: #e2e8f0;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 20px rgba(0,0,0,0.06);
    --shadow-lg: 0 12px 40px rgba(0,0,0,0.08);
    --radius: 12px;
    --radius-sm: 8px;
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-ui: 'Inter', sans-serif;
}

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: var(--font-ui);
    background: var(--bg);
    color: var(--fg);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
}

/* ===== Layout ===== */
.login-wrapper {
    display: flex;
    min-height: 100vh;
}

/* ===== Left Panel ===== */
.brand-panel {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: linear-gradient(160deg, #1a365d 0%, #132744 35%, #0c1f3a 65%, #091729 100%);
    padding: 36px 40px;
    position: relative;
    overflow: hidden;
}

    /* Subtle grid pattern */
    .brand-panel::before {
        content: '';
        position: absolute;
        inset: 0;
        background-image: radial-gradient(circle at 1px 1px, rgba(255,255,255,0.03) 1px, transparent 0);
        background-size: 32px 32px;
        z-index: 0;
    }

    /* Top right glow */
    .brand-panel::after {
        content: '';
        position: absolute;
        width: 600px;
        height: 600px;
        border-radius: 50%;
        background: radial-gradient(circle, rgba(59, 130, 246, 0.1) 0%, transparent 65%);
        top: -200px;
        right: -150px;
        z-index: 0;
    }

.brand-logo {
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
    z-index: 2;
}

.brand-logo-icon {
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 16px;
    box-shadow: 0 4px 14px rgba(37, 99, 235, 0.35);
}

.brand-logo-text {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: 19px;
    color: #ffffff;
    letter-spacing: -0.3px;
}

    .brand-logo-text span {
        font-weight: 600;
        color: #60a5fa;
    }

/* Illustration area */
.brand-illustration {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    z-index: 1;
    padding: 10px 0;
}

.illustration-wrap {
    width: 100%;
    max-width: 480px;
    position: relative;
}

/* Background glow circles on left panel */
.bg-glow {
    position: absolute;
    border-radius: 50%;
    z-index: 0;
}

.bg-glow-1 {
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(59,130,246,0.08) 0%, transparent 70%);
    bottom: 10%;
    left: 5%;
}

.bg-glow-2 {
    width: 150px;
    height: 150px;
    background: radial-gradient(circle, rgba(56,189,248,0.06) 0%, transparent 70%);
    top: 20%;
    right: 10%;
}

/* Floating decorative elements */
.deco-float {
    position: absolute;
    z-index: 1;
}

.deco-circle {
    border-radius: 50%;
    border: 1.5px solid rgba(96, 165, 250, 0.15);
}

    .deco-circle.c1 {
        width: 40px;
        height: 40px;
        top: 8%;
        left: 8%;
        animation: decoFloat 7s ease-in-out infinite;
    }

    .deco-circle.c2 {
        width: 24px;
        height: 24px;
        top: 15%;
        right: 12%;
        border-color: rgba(96, 165, 250, 0.1);
        animation: decoFloat 5s ease-in-out infinite 1s;
    }

    .deco-circle.c3 {
        width: 16px;
        height: 16px;
        bottom: 25%;
        left: 3%;
        border-color: rgba(96, 165, 250, 0.2);
        animation: decoFloat 6s ease-in-out infinite 2s;
    }

.deco-dot {
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.25);
}

    .deco-dot.d1 {
        width: 6px;
        height: 6px;
        top: 35%;
        left: 2%;
        animation: decoFloat 4s ease-in-out infinite 0.5s;
    }

    .deco-dot.d2 {
        width: 4px;
        height: 4px;
        bottom: 18%;
        right: 5%;
        animation: decoFloat 5s ease-in-out infinite 1.5s;
    }

    .deco-dot.d3 {
        width: 5px;
        height: 5px;
        top: 10%;
        left: 45%;
        animation: decoFloat 6s ease-in-out infinite 3s;
    }

    .deco-dot.d4 {
        width: 3px;
        height: 3px;
        bottom: 35%;
        right: 2%;
        animation: decoFloat 4.5s ease-in-out infinite 0.8s;
    }

.deco-square {
    border-radius: 4px;
    border: 1.5px solid rgba(96, 165, 250, 0.12);
    transform: rotate(15deg);
}

    .deco-square.s1 {
        width: 18px;
        height: 18px;
        bottom: 12%;
        right: 15%;
        animation: decoFloat 8s ease-in-out infinite 0.3s;
    }

    .deco-square.s2 {
        width: 12px;
        height: 12px;
        top: 50%;
        left: 5%;
        animation: decoFloat 6s ease-in-out infinite 2.5s;
        transform: rotate(-20deg);
    }

@keyframes decoFloat {
    0%, 100% {
        transform: translateY(0) rotate(var(--rot, 0deg));
    }

    50% {
        transform: translateY(-12px) rotate(var(--rot, 0deg));
    }
}

.deco-circle.c1 {
    --rot: 0deg;
}

.deco-circle.c2 {
    --rot: 0deg;
}

.deco-circle.c3 {
    --rot: 0deg;
}

.deco-square.s1 {
    --rot: 15deg;
}

.deco-square.s2 {
    --rot: -20deg;
}

/* Brand footer */
.brand-footer {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 8px;
}

.brand-footer-icon {
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: rgba(96, 165, 250, 0.12);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .brand-footer-icon i {
        color: #60a5fa;
        font-size: 10px;
    }

.brand-footer span {
    color: rgba(255,255,255,0.35);
    font-size: 11.5px;
}

/* ===== Right Panel — Form ===== */
.form-panel {
    width: 520px;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 60px 56px;
    background: var(--bg-card);
    position: relative;
}

.form-header {
    margin-bottom: 32px;
}

    .form-header h2 {
        font-family: var(--font-display);
        font-size: 30px;
        font-weight: 800;
        color: var(--fg);
        margin-bottom: 6px;
        letter-spacing: -0.5px;
    }

    .form-header p {
        font-size: 15px;
        color: var(--fg-muted);
    }

.form-group {
    margin-bottom: 20px;
}

.form-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--fg);
    margin-bottom: 7px;
}

.input-wrapper {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: var(--fg-dim);
    transition: color 0.25s ease;
    pointer-events: none;
    z-index: 2;
}

.form-input {
    width: 100%;
    padding: 12px 14px 12px 44px;
    font-family: var(--font-ui);
    font-size: 14px;
    color: var(--fg);
    background: var(--input-bg);
    border: 1.5px solid var(--input-border);
    border-radius: var(--radius-sm);
    outline: none;
    transition: all 0.25s ease;
}

    .form-input::placeholder {
        color: var(--fg-dim);
    }

    .form-input:focus {
        border-color: var(--input-border-focus);
        background: #fff;
        box-shadow: 0 0 0 3px var(--accent-glow);
    }

.input-wrapper:focus-within .input-icon {
    color: var(--accent);
}

.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--fg-dim);
    cursor: pointer;
    font-size: 14px;
    padding: 4px;
    transition: color 0.2s ease;
    z-index: 2;
}

    .toggle-password:hover {
        color: var(--accent);
    }

.form-options {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.remember-me {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    user-select: none;
}

    .remember-me input {
        display: none;
    }

.custom-check {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    border: 1.5px solid var(--input-border);
    background: var(--input-bg);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

    .custom-check i {
        font-size: 10px;
        color: white;
        opacity: 0;
        transform: scale(0.4);
        transition: all 0.2s ease;
    }

.remember-me input:checked + .custom-check {
    background: var(--accent);
    border-color: var(--accent);
}

    .remember-me input:checked + .custom-check i {
        opacity: 1;
        transform: scale(1);
    }

.remember-me span {
    font-size: 13px;
    color: var(--fg-muted);
}

.forgot-link {
    font-size: 13px;
    color: var(--accent);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.2s ease;
}

    .forgot-link:hover {
        color: var(--accent-hover);
        text-decoration: underline;
    }

.btn-submit {
    width: 100%;
    padding: 13px;
    font-family: var(--font-ui);
    font-size: 15px;
    font-weight: 600;
    color: white;
    background: var(--accent);
    border: none;
    border-radius: var(--radius-sm);
    cursor: pointer;
    position: relative;
    overflow: hidden;
    transition: all 0.25s ease;
    box-shadow: 0 2px 10px var(--accent-glow);
}

    .btn-submit:hover {
        background: var(--accent-hover);
        box-shadow: 0 4px 18px rgba(37, 99, 235, 0.25);
        transform: translateY(-1px);
    }

    .btn-submit:active {
        transform: translateY(0);
    }

    .btn-submit span {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
    }

    .btn-submit.loading span {
        opacity: 0;
    }

    .btn-submit.loading::after {
        content: '';
        position: absolute;
        width: 20px;
        height: 20px;
        border: 2.5px solid rgba(255,255,255,0.3);
        border-top-color: white;
        border-radius: 50%;
        animation: spin 0.6s linear infinite;
        top: 50%;
        left: 50%;
        margin-top: -10px;
        margin-left: -10px;
    }

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

.btn-ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    transform: scale(0);
    animation: ripple 0.5s linear;
    pointer-events: none;
}

@keyframes ripple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

.field-error {
    font-size: 12px;
    color: var(--danger);
    margin-top: 5px;
    display: none;
    align-items: center;
    gap: 4px;
    animation: errorIn 0.25s ease;
}

    .field-error.visible {
        display: flex;
    }

@keyframes errorIn {
    from {
        opacity: 0;
        transform: translateY(-3px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.form-input.error {
    border-color: var(--danger);
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
}

.toast-container {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.toast {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 18px;
    border-radius: var(--radius-sm);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    font-size: 13px;
    color: var(--fg);
    transform: translateX(120%);
    animation: toastIn 0.35s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    max-width: 340px;
}

    .toast.out {
        animation: toastOut 0.25s ease forwards;
    }

.toast-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 13px;
}

    .toast-icon.error {
        background: #fef2f2;
        color: var(--danger);
    }

    .toast-icon.success {
        background: #f0fdf4;
        color: #16a34a;
    }

@keyframes toastIn {
    to {
        transform: translateX(0);
    }
}

@keyframes toastOut {
    to {
        transform: translateX(120%);
        opacity: 0;
    }
}

.stagger {
    opacity: 0;
    transform: translateY(14px);
    animation: staggerIn 0.45s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes staggerIn {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes shake {
    0%, 100% {
        transform: translateX(0);
    }

    20% {
        transform: translateX(-5px);
    }

    40% {
        transform: translateX(5px);
    }

    60% {
        transform: translateX(-3px);
    }

    80% {
        transform: translateX(3px);
    }
}

@keyframes personFloat {
    0%, 100% {
        transform: translateY(0);
    }

    50% {
        transform: translateY(-8px);
    }
}

@keyframes cardFloat {
    0%, 100% {
        transform: translateY(0) rotate(-2deg);
    }

    50% {
        transform: translateY(-10px) rotate(-2deg);
    }
}

@keyframes shieldPulse {
    0%, 100% {
        filter: drop-shadow(0 0 8px rgba(59,130,246,0.3));
    }

    50% {
        filter: drop-shadow(0 0 20px rgba(59,130,246,0.5));
    }
}

@media (max-width: 960px) {
    .brand-panel {
        display: none;
    }

    .form-panel {
        width: 100%;
        padding: 40px 28px;
    }

    .mobile-brand {
        display: flex !important;
        margin-bottom: 32px;
    }
}

.mobile-brand {
    display: none;
    align-items: center;
    gap: 10px;
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        transition-duration: 0.01ms !important;
    }
}

.form-input:focus-visible,
.btn-submit:focus-visible,
.forgot-link:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

