:root {
    --indigo: #4f46e5;
    --indigo-dark: #3730a3;
    --indigo-light: #e0e7ff;
    --indigo-50: #eef2ff;
    --green: #10b981;
    --green-light: #d1fae5;
    --blue: #3b82f6;
    --blue-light: #dbeafe;
    --purple: #a855f7;
    --purple-light: #f3e8ff;
    --amber: #f59e0b;
    --amber-light: #fef3c7;
    --red: #ef4444;
    --red-light: #fee2e2;
    --text-primary: #111827;
    --text-secondary: #6b7280;
    --text-muted: #9ca3af;
    --border: #e5e7eb;
    --white: #ffffff;
    --bg-page: #f8fafc;
    --shadow-sm: 0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.08), 0 2px 6px rgba(0,0,0,0.04);
    --shadow-card: 0 2px 12px rgba(79,70,229,0.08), 0 1px 4px rgba(0,0,0,0.05);
    --shadow-xl: 0 20px 60px rgba(79,70,229,0.14), 0 8px 24px rgba(0,0,0,0.08);
    --radius: 16px;
    --radius-sm: 10px;
}

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

html, body {
    height: 100%;
    overflow: hidden;
}

body {
    font-family: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    background: var(--bg-page);
    color: var(--text-primary);
    -webkit-font-smoothing: antialiased;
}

/* ── Page Layout ── */
.page-wrapper {
    display: flex;
    height: 100vh;
    width: 100vw;
}

/* ═══════════════════════════════════
   HERO PANEL (70%) — LIGHT THEME
═══════════════════════════════════ */
.hero-panel {
    flex: 0 0 70%;
    position: relative;
    overflow: hidden;
    background: linear-gradient(145deg, #f0f4ff 0%, #fafbff 45%, #f5f3ff 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--border);
}

/* Soft pastel animated orbs */
.hero-bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(90px);
}

.orb-1 {
    width: 640px;
    height: 640px;
    background: radial-gradient(circle, rgba(165,180,252,0.45), rgba(199,210,254,0.2));
    top: -240px;
    left: -160px;
    animation: drift1 14s ease-in-out infinite alternate;
}

.orb-2 {
    width: 520px;
    height: 520px;
    background: radial-gradient(circle, rgba(196,181,253,0.35), rgba(221,214,254,0.15));
    bottom: -200px;
    right: -80px;
    animation: drift2 17s ease-in-out infinite alternate;
}

.orb-3 {
    width: 380px;
    height: 380px;
    background: radial-gradient(circle, rgba(110,231,183,0.25), rgba(167,243,208,0.1));
    bottom: 22%;
    left: 18%;
    animation: drift3 11s ease-in-out infinite alternate;
}

.grid-lines {
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(79,70,229,0.05) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79,70,229,0.05) 1px, transparent 1px);
    background-size: 60px 60px;
}

@keyframes drift1 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(70px, 90px) scale(1.12); }
}
@keyframes drift2 {
    from { transform: translate(0, 0) scale(1); }
    to   { transform: translate(-55px, -65px) scale(1.08); }
}
@keyframes drift3 {
    from { transform: translate(0, 0) rotate(0deg); }
    to   { transform: translate(45px, -45px) rotate(22deg); }
}

/* Hero Content */
.hero-content {
    position: relative;
    z-index: 2;
    padding: 48px 60px;
    max-width: 700px;
    width: 100%;
    animation: fadeInUp 0.8s ease both;
}

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

/* Brand */
.brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 52px;
}

.brand-icon {
    width: 44px;
    height: 44px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--shadow-sm);
}

.brand-name {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Hero text */
.hero-text {
    margin-bottom: 44px;
}

.hero-text h1 {
    font-size: clamp(2rem, 3.2vw, 3rem);
    font-weight: 800;
    line-height: 1.18;
    color: var(--text-primary);
    letter-spacing: -1px;
    margin-bottom: 18px;
}

.hero-text h1 .highlight {
    background: linear-gradient(90deg, var(--indigo), #7c3aed);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1.05rem;
    color: var(--text-secondary);
    line-height: 1.65;
    max-width: 480px;
    font-weight: 400;
}

/* Stat cards — light style */
.stat-cards {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
    margin-bottom: 36px;
    max-width: 480px;
}

.stat-card {
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 16px 18px;
    display: flex;
    align-items: center;
    gap: 14px;
    box-shadow: var(--shadow-card);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.stat-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(79,70,229,0.12), 0 3px 8px rgba(0,0,0,0.06);
}

.stat-icon {
    width: 38px;
    height: 38px;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.stat-green  { background: var(--green-light);  color: #059669; }
.stat-blue   { background: var(--blue-light);   color: #2563eb; }
.stat-purple { background: var(--purple-light); color: #7c3aed; }
.stat-amber  { background: var(--amber-light);  color: #d97706; }

.stat-info {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.stat-value {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1;
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* Float animations */
@keyframes float {
    0%, 100% { transform: translateY(0px); }
    50%       { transform: translateY(-8px); }
}

.float-1 { animation: float 5s ease-in-out infinite; }
.float-2 { animation: float 6.5s ease-in-out infinite 0.8s; }
.float-3 { animation: float 5.8s ease-in-out infinite 1.6s; }
.float-4 { animation: float 7s ease-in-out infinite 0.4s; }

/* Trust bar */
.trust-bar {
    display: flex;
    align-items: center;
    gap: 10px;
}

.trust-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--green);
    box-shadow: 0 0 0 0 rgba(16,185,129,0.4);
    animation: pulse 2s ease-in-out infinite;
    flex-shrink: 0;
}

@keyframes pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(16,185,129,0.4); }
    50%       { box-shadow: 0 0 0 6px rgba(16,185,129,0); }
}

.trust-text {
    font-size: 0.85rem;
    color: var(--text-secondary);
    font-weight: 500;
}

/* ═══════════════════════════════════
   LOGIN PANEL (30%)
═══════════════════════════════════ */
.login-panel {
    flex: 0 0 30%;
    background: var(--white);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 36px;
    position: relative;
    overflow-y: auto;
}

.login-card {
    width: 100%;
    max-width: 340px;
    animation: fadeInUp 0.9s ease 0.2s both;
}

/* Login logo */
.login-logo {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 36px;
}

.login-logo-icon {
    width: 36px;
    height: 36px;
    background: var(--indigo-light);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-logo-text {
    font-size: 1.1rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.3px;
}

/* Login header */
.login-header {
    margin-bottom: 28px;
}

.login-header h2 {
    font-size: 1.65rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.5px;
    margin-bottom: 6px;
}

.login-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
    font-weight: 400;
}

/* Session expired banner */
.session-expired-banner {
    display: none;
    align-items: center;
    gap: 8px;
    background: var(--red-light);
    border: 1px solid #fca5a5;
    color: #b91c1c;
    padding: 11px 14px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 500;
    margin-bottom: 20px;
    animation: fadeInUp 0.4s ease both;
}

/* Floating label inputs */
.field-group {
    position: relative;
    margin-bottom: 20px;
}

.field-input {
    width: 100%;
    padding: 18px 14px 6px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    color: var(--text-primary);
    background: #fafafa;
    outline: none;
    transition: border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
    -webkit-appearance: none;
}

.field-input:focus {
    border-color: var(--indigo);
    background: var(--white);
    box-shadow: 0 0 0 4px rgba(79,70,229,0.08);
}

.field-label {
    position: absolute;
    top: 50%;
    left: 14px;
    transform: translateY(-50%);
    font-size: 0.9rem;
    color: var(--text-muted);
    font-weight: 500;
    pointer-events: none;
    transition: top 0.18s ease, font-size 0.18s ease, color 0.18s ease, transform 0.18s ease;
    transform-origin: left center;
}

.field-input:focus ~ .field-label,
.field-input:not(:placeholder-shown) ~ .field-label,
.field-input:-webkit-autofill ~ .field-label,
.field-input:autofill ~ .field-label {
    top: 10px;
    transform: translateY(0) scale(0.8);
    font-size: 0.75rem;
    color: var(--indigo);
}

.field-input:-webkit-autofill,
.field-input:-webkit-autofill:hover,
.field-input:-webkit-autofill:focus {
    -webkit-box-shadow: 0 0 0px 1000px #fafafa inset;
    box-shadow: 0 0 0px 1000px #fafafa inset;
    -webkit-text-fill-color: var(--text-primary);
    border-color: var(--border);
    transition: background-color 9999s ease-in-out 0s;
}

/* Password toggle */
.toggle-pw {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: var(--text-muted);
    padding: 4px;
    display: flex;
    align-items: center;
    transition: color 0.2s;
}

.toggle-pw:hover { color: var(--indigo); }

/* Auth button */
.auth-btn {
    width: 100%;
    padding: 14px;
    background: var(--indigo);
    color: white;
    border: none;
    border-radius: var(--radius-sm);
    font-size: 0.95rem;
    font-family: inherit;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.2px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    transition: background 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 4px 14px rgba(79,70,229,0.3);
    margin-top: 6px;
}

.auth-btn:hover:not(:disabled) {
    background: var(--indigo-dark);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(79,70,229,0.38);
}

.auth-btn:active:not(:disabled) {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(79,70,229,0.25);
}

.auth-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
}

/* Spinner */
.btn-spinner svg {
    animation: spin 0.8s linear infinite;
}

@keyframes spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

/* Error message */
.error-msg {
    display: none;
    align-items: center;
    gap: 6px;
    color: var(--red);
    font-size: 0.82rem;
    font-weight: 500;
    margin-top: 12px;
    padding: 10px 12px;
    background: var(--red-light);
    border-radius: 8px;
    animation: shake 0.35s ease both;
}

@keyframes shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-5px); }
    60%       { transform: translateX(5px); }
}

/* Login footer */
.login-footer {
    position: absolute;
    bottom: 20px;
    font-size: 0.75rem;
    color: var(--text-muted);
    font-weight: 400;
    text-align: center;
}

/* ═══════════════════════════════════
   PANEL SELECTOR MODAL
═══════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(17, 24, 39, 0.45);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
    padding: 20px;
}

.modal-overlay.modal-active {
    opacity: 1;
    visibility: visible;
}

.modal-box {
    background: var(--white);
    border-radius: 24px;
    padding: 40px 36px;
    width: 100%;
    max-width: 480px;
    box-shadow: var(--shadow-xl);
    transform: scale(0.9) translateY(16px);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.modal-active .modal-box {
    transform: scale(1) translateY(0);
}

/* Modal header */
.modal-header {
    text-align: center;
    margin-bottom: 28px;
}

.modal-check {
    width: 52px;
    height: 52px;
    background: linear-gradient(135deg, var(--green), #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    margin: 0 auto 16px;
    box-shadow: 0 6px 20px rgba(16,185,129,0.35);
    animation: popIn 0.5s cubic-bezier(0.34, 1.56, 0.64, 1) 0.1s both;
}

@keyframes popIn {
    from { transform: scale(0); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}

.modal-header h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text-primary);
    letter-spacing: -0.4px;
    margin-bottom: 6px;
}

.modal-header p {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* Modal panel cards */
.modal-panels {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.panel-card {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 18px 20px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    text-decoration: none;
    background: #fafafa;
    transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
    animation: fadeInUp 0.4s ease both;
}

.panel-card:nth-child(1) { animation-delay: 0.05s; }
.panel-card:nth-child(2) { animation-delay: 0.12s; }
.panel-card:nth-child(3) { animation-delay: 0.19s; }

.panel-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.panel-card-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    flex-shrink: 0;
}

.panel-card-info {
    flex: 1;
}

.panel-card-name {
    font-size: 0.97rem;
    font-weight: 700;
    color: var(--text-primary);
    display: block;
    margin-bottom: 2px;
}

.panel-card-desc {
    font-size: 0.78rem;
    color: var(--text-secondary);
    font-weight: 400;
}

.panel-card-arrow {
    color: var(--text-muted);
    transition: transform 0.2s ease, color 0.2s ease;
    flex-shrink: 0;
}

.panel-card:hover .panel-card-arrow {
    transform: translateX(3px);
    color: var(--text-secondary);
}

/* Dev card */
.card-dev { border-color: #c7d2fe; }
.card-dev:hover { border-color: var(--indigo); background: #f5f3ff; }
.card-dev .panel-card-icon { background: var(--indigo-light); }
.card-dev .panel-card-name { color: var(--indigo); }

/* Cashier card */
.card-cashier { border-color: #a7f3d0; }
.card-cashier:hover { border-color: var(--green); background: #f0fdf4; }
.card-cashier .panel-card-icon { background: var(--green-light); }
.card-cashier .panel-card-name { color: #065f46; }

/* Inventory card */
.card-inventory { border-color: #e9d5ff; }
.card-inventory:hover { border-color: var(--purple); background: #faf5ff; }
.card-inventory .panel-card-icon { background: var(--purple-light); }
.card-inventory .panel-card-name { color: #6b21a8; }


/* Admin card */
.card-admin { border-color: #e0e7ff; } /* Light tint border */
.card-admin:hover { border-color: var(--indigo, #4f46e5); background: #eef2ff; } /* Solid border & very light bg on hover */
.card-admin .panel-card-icon { background: var(--indigo-light, #e0e7ff); } /* Icon container background */
.card-admin .panel-card-name { color: #4338ca; } /* Deep text color for the title */


/* ═══════════════════════════════════
   RESPONSIVE
═══════════════════════════════════ */
@media (max-width: 900px) {
    html, body { overflow: auto; }
    .page-wrapper {
        flex-direction: column;
        height: auto;
        min-height: 100vh;
    }
    .hero-panel {
        flex: none;
        min-height: 300px;
        border-right: none;
        border-bottom: 1px solid var(--border);
    }
    .hero-content { padding: 36px 28px; }
    .hero-text h1 { font-size: 1.8rem; }
    .stat-cards { grid-template-columns: repeat(2, 1fr); max-width: 100%; }
    .login-panel { flex: none; padding: 36px 28px 60px; }
    .login-footer { position: static; margin-top: 24px; }
}

@media (max-width: 480px) {
    .stat-cards { grid-template-columns: 1fr 1fr; gap: 10px; }
    .stat-card { padding: 12px 14px; }
    .hero-text h1 { font-size: 1.5rem; }
    .modal-box { padding: 28px 20px; }
}
