/* ========================================================================
   APEX Premium Login — Dark Split-Screen
   Inspired by the Lake/Prime design language.
   ======================================================================== */

/* Font: uses Inter from base template (no separate import needed) */

:root {
    --primary-color: #06b6d4;
    --primary-hover: #0891b2;
    --secondary-color: #94a3b8;
    --accent-color: #8b5cf6;
    --bg-surface-0: #090d1a;
    --bg-surface-1: #0c1224;
    --bg-surface-2: #111827;
    --text-main: #f1f5f9;
    --text-muted: #94a3b8;
    --text-dim: #64748b;
    --glass-bg: linear-gradient(135deg, rgba(17, 24, 39, 0.8), rgba(26, 34, 54, 0.5));
    --glass-border: rgba(255, 255, 255, 0.06);
    --glass-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
    --transition-speed: 0.3s;
}

/* OVERRIDE BASE LAYOUT STYLES */
.auth-layout {
    background: none !important;
    display: block !important;
    min-height: auto !important;
    padding: 0 !important;
}

body {
    font-family: Inter, -apple-system, BlinkMacSystemFont, sans-serif;
    margin: 0;
    padding: 0;
    overflow-x: hidden;
    background: var(--bg-surface-0);
    color: var(--text-main);
    -webkit-font-smoothing: antialiased;
}

/* ── Split-Screen Layout ──────────────────────────────────────────── */

.login-wrapper {
    position: relative;
    width: 100vw;
    min-height: 100vh;
    display: flex;
    overflow: hidden;
}

/* Left Panel — Brand & Info */
.login-brand-panel {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 480px;
    padding: 48px;
    position: relative;
    z-index: 10;
}

@media (min-width: 1024px) {
    .login-brand-panel { display: flex; }
}

.login-brand-panel .brand-logo-row {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 64px;
}

.login-brand-panel .brand-icon {
    width: 44px;
    height: 44px;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    display: flex;
    align-items: center;
    justify-content: center;
}

.login-brand-panel .brand-icon img {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
}

.login-brand-panel .brand-label {
    font-size: 1.125rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.login-brand-panel .brand-sub {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.login-brand-panel h2 {
    font-size: 1.875rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    line-height: 1.2;
    margin-bottom: 16px;
}

.login-brand-panel h2 .gradient-text {
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.login-brand-panel .brand-description {
    font-size: 0.875rem;
    color: var(--text-muted);
    line-height: 1.6;
    max-width: 360px;
}

/* Stats row */
.login-stats {
    display: flex;
    gap: 24px;
    margin-top: 40px;
}

.login-stat {
    display: flex;
    align-items: center;
    gap: 10px;
}

.login-stat-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.875rem;
}

.login-stat-icon.cyan { background: rgba(6, 182, 212, 0.1); color: var(--primary-color); }
.login-stat-icon.green { background: rgba(34, 197, 94, 0.1); color: #22c55e; }
.login-stat-icon.purple { background: rgba(139, 92, 246, 0.1); color: #8b5cf6; }

.login-stat-value {
    font-size: 0.875rem;
    font-weight: 600;
}

.login-stat-label {
    font-size: 0.6875rem;
    color: var(--text-dim);
}

.login-brand-footer {
    font-size: 0.6875rem;
    color: rgba(148, 163, 184, 0.5);
    line-height: 1.5;
}

/* Right Panel — Form */
.login-form-panel {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px;
    position: relative;
    z-index: 10;
}

/* ── Background ───────────────────────────────────────────────────── */

.parallax-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg-surface-0);
}

.parallax-bg::before {
    content: '';
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 600px 600px at 15% 25%, rgba(6, 182, 212, 0.07), transparent 70%),
        radial-gradient(ellipse 500px 500px at 80% 70%, rgba(139, 92, 246, 0.05), transparent 70%);
}

/* Grid overlay */
.parallax-bg::after {
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.02) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.02) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 70% 60% at 50% 50%, black 30%, transparent 80%);
}

/* Animated orbs */
.shape {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    animation: orbFloat 25s infinite ease-in-out;
}

.shape-1 {
    width: 400px; height: 400px;
    top: -8%; left: -5%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.15), transparent 70%);
    opacity: 0.5;
}

.shape-2 {
    width: 350px; height: 350px;
    bottom: -10%; right: -3%;
    background: radial-gradient(circle, rgba(139, 92, 246, 0.12), transparent 70%);
    animation-delay: -8s;
    opacity: 0.4;
}

.shape-3 {
    width: 250px; height: 250px;
    top: 40%; right: 20%;
    background: radial-gradient(circle, rgba(6, 182, 212, 0.08), transparent 70%);
    animation-delay: -16s;
    opacity: 0.3;
}

@keyframes orbFloat {
    0%, 100% { transform: translate(0, 0) scale(1); opacity: 0.3; }
    25% { transform: translate(30px, -20px) scale(1.05); opacity: 0.5; }
    50% { transform: translate(-20px, 30px) scale(0.95); opacity: 0.4; }
    75% { transform: translate(15px, 15px) scale(1.02); opacity: 0.45; }
}

/* ── Glass Card ───────────────────────────────────────────────────── */

.glass-card {
    position: relative;
    width: 100%;
    max-width: 440px;
    padding: 2rem;
    background: var(--glass-bg);
    backdrop-filter: blur(20px) saturate(150%);
    -webkit-backdrop-filter: blur(20px) saturate(150%);
    border-radius: 16px;
    border: 1px solid var(--glass-border);
    box-shadow: var(--glass-shadow);
    z-index: 10;
    animation: cardIn 0.5s ease-out;
}

/* Subtle glow ring on hover */
.glass-card::after {
    content: '';
    position: absolute;
    inset: -1px;
    border-radius: 17px;
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.15), transparent 40%, transparent 60%, rgba(139, 92, 246, 0.1));
    z-index: -1;
    opacity: 0;
    transition: opacity 0.4s;
}

.glass-card:hover::after { opacity: 1; }

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

/* ── Branding in Card ─────────────────────────────────────────────── */

.brand-header {
    text-align: center;
    margin-bottom: 1.5rem;
}

.brand-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    letter-spacing: -0.02em;
}

.brand-subtitle {
    font-size: 0.8125rem;
    color: var(--text-muted);
    margin: 4px 0 0;
}

/* ── Role Tabs ────────────────────────────────────────────────────── */

.role-tabs {
    display: flex;
    background: rgba(255, 255, 255, 0.04);
    padding: 4px;
    border-radius: 12px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--glass-border);
}

.role-tab {
    flex: 1;
    border: none;
    background: none;
    padding: 10px 12px;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-dim);
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.2s ease;
    font-family: inherit;
}

.role-tab:hover {
    color: var(--text-main);
    background: rgba(255, 255, 255, 0.04);
}

.role-tab.active {
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--bg-surface-0);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.3);
}

/* ── Forms ─────────────────────────────────────────────────────────── */

.form-group {
    margin-bottom: 1.25rem;
}

.form-label {
    display: block;
    font-size: 0.8125rem;
    font-weight: 500;
    color: var(--text-muted);
    margin-bottom: 6px;
}

.modern-input {
    width: 100%;
    padding: 0.7rem 0.875rem;
    border: 1px solid var(--glass-border);
    border-radius: 10px;
    background: rgba(255, 255, 255, 0.04);
    font-size: 0.9375rem;
    color: var(--text-main);
    transition: all 0.2s ease;
    box-sizing: border-box;
    font-family: inherit;
    outline: none;
}

.modern-input::placeholder {
    color: var(--text-dim);
}

.modern-input:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(6, 182, 212, 0.12);
    background: rgba(255, 255, 255, 0.06);
}

/* ── Buttons ──────────────────────────────────────────────────────── */

.submit-btn,
.btn-primary-modern {
    width: 100%;
    padding: 0.75rem 1.5rem;
    background: linear-gradient(135deg, var(--primary-color), var(--primary-hover));
    color: var(--bg-surface-0);
    border: none;
    border-radius: 10px;
    font-weight: 600;
    font-size: 0.9375rem;
    cursor: pointer;
    transition: all 0.2s ease;
    box-shadow: 0 4px 14px rgba(6, 182, 212, 0.25);
    font-family: inherit;
}

.submit-btn:hover,
.btn-primary-modern:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(6, 182, 212, 0.35);
}

.submit-btn:active,
.btn-primary-modern:active {
    transform: scale(0.98);
}

/* ── Login Header ─────────────────────────────────────────────────── */

.login-header {
    text-align: center;
    margin-bottom: 1.25rem;
}

.login-title-text {
    font-size: 1.125rem;
    font-weight: 700;
    color: var(--text-main);
    margin: 0 0 4px;
}

.login-subtitle-text {
    font-size: 0.8125rem;
    color: var(--text-muted);
}

/* ── Footer & Links ───────────────────────────────────────────────── */

.footer-links {
    margin-top: 1.5rem;
    text-align: center;
}

.link-modern {
    color: var(--primary-color);
    text-decoration: none;
    font-size: 0.8125rem;
    font-weight: 500;
}

.link-modern:hover {
    color: #22d3ee;
    text-decoration: underline;
}

.login-footer {
    text-align: center;
    margin-top: 1.5rem;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.system-notices {
    margin-top: 1rem;
    padding-top: 1rem;
    border-top: 1px solid var(--glass-border);
}

/* ── Alerts ────────────────────────────────────────────────────────── */

.alert {
    padding: 0.625rem 1rem;
    border-radius: 10px;
    font-size: 0.8125rem;
    margin-bottom: 1rem;
    border: 1px solid var(--glass-border);
    background: rgba(255, 255, 255, 0.03);
}

.alert-danger {
    border-color: rgba(239, 68, 68, 0.2);
    background: rgba(239, 68, 68, 0.06);
    color: #fca5a5;
}

.alert-success {
    border-color: rgba(34, 197, 94, 0.2);
    background: rgba(34, 197, 94, 0.06);
    color: #86efac;
}

.alert-info {
    border-color: rgba(59, 130, 246, 0.2);
    background: rgba(59, 130, 246, 0.06);
    color: #93c5fd;
}

/* ── Password Toggle ──────────────────────────────────────────────── */

.password-toggle,
.toggle-password {
    position: absolute;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    padding: 4px;
}

/* ── Utilities ─────────────────────────────────────────────────────── */

.d-none { display: none !important; }

.fade-in {
    animation: cardIn 0.5s ease-out;
}

/* ── Responsive ────────────────────────────────────────────────────── */

@media (max-width: 640px) {
    .glass-card {
        padding: 1.5rem;
        max-width: 100%;
        margin: 1rem;
        border-radius: 14px;
    }

    .role-tabs {
        flex-direction: column;
        gap: 4px;
    }
}
