/* ==================================================================
   E-Vision - Login Split-Screen Premium
   Meta: visual igual aos melhores SaaS (Linear/Vercel/Raycast)
   ================================================================== */

:root {
  --bg: #050810;
  --bg-card: #0A0E1A;
  --border: rgba(148, 163, 184, 0.12);
  --border-focus: #F0B90B;
  --text: #F1F5F9;
  --text-soft: #94A3B8;
  --text-muted: #64748B;
  --accent: #F0B90B;
  --accent-hover: #F5C423;
  --accent-glow: rgba(240, 185, 11, 0.25);
  --accent-soft: rgba(240, 185, 11, 0.08);
  --error: #EF4444;
  --error-bg: rgba(239, 68, 68, 0.08);
  --font: 'Plus Jakarta Sans', system-ui, -apple-system, sans-serif;
  --radius: 14px;
  --radius-lg: 20px;
  --shadow-card: 0 1px 3px rgba(0,0,0,0.4), 0 20px 60px -20px rgba(0,0,0,0.6);
}

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

html, body { height: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow: hidden;
}

/* ============ SPLIT LAYOUT ============ */
.login-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ============ LADO ESQUERDO: VISUAL ============ */
.panel-visual {
  position: relative;
  background:
    radial-gradient(ellipse 80% 60% at 30% 40%, rgba(240, 185, 11, 0.15) 0%, transparent 60%),
    radial-gradient(ellipse 60% 50% at 80% 80%, rgba(99, 102, 241, 0.12) 0%, transparent 60%),
    linear-gradient(160deg, #060A14 0%, #0A0F1E 50%, #060A14 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: clamp(32px, 6vh, 64px) clamp(32px, 5vw, 72px);
  overflow: hidden;
}

/* Textura de grid sutil */
.visual-noise {
  position: absolute; inset: 0;
  background-image:
    linear-gradient(rgba(148,163,184,0.02) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148,163,184,0.02) 1px, transparent 1px);
  background-size: 40px 40px;
  mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 80%);
  -webkit-mask-image: radial-gradient(ellipse 90% 80% at 50% 50%, black 30%, transparent 80%);
}

/* Brilho dinâmico */
.visual-glow {
  position: absolute; inset: 0;
  background: radial-gradient(circle at 40% 30%, rgba(240, 185, 11, 0.1) 0%, transparent 50%);
  animation: pulse 6s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.4; transform: scale(0.95); }
  50% { opacity: 0.8; transform: scale(1.05); }
}

.visual-content {
  position: relative;
  z-index: 2;
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 520px;
}

/* Logo */
.panel-logo {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: clamp(32px, 6vh, 56px);
}
.panel-logo svg { width: clamp(36px, 5vh, 44px); height: clamp(36px, 5vh, 44px); }
.panel-brand-name {
  font-size: clamp(17px, 2.5vh, 20px);
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* Texto principal */
.visual-text h1 {
  font-size: clamp(30px, 5.5vw, 52px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  margin-bottom: clamp(16px, 3vh, 28px);
  background: linear-gradient(135deg, #F1F5F9 0%, #94A3B8 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.visual-text h1 em {
  font-style: normal;
  background: linear-gradient(135deg, var(--accent) 0%, #FF9500 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  position: relative;
}
.visual-text h1 em::after {
  content: '';
  position: absolute;
  left: 0; bottom: 2px;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), transparent);
  border-radius: 2px;
}
.visual-text p {
  font-size: clamp(14px, 2.2vh, 17px);
  color: var(--text-soft);
  line-height: 1.65;
  max-width: 44ch;
  font-weight: 400;
}

/* Stats */
.visual-stats {
  display: flex;
  gap: clamp(24px, 4vw, 48px);
  margin-top: clamp(32px, 6vh, 52px);
  padding-top: clamp(24px, 4vh, 36px);
  border-top: 1px solid var(--border);
}
.stat { display: flex; flex-direction: column; gap: 4px; }
.stat-num {
  font-size: clamp(22px, 3.2vh, 28px);
  font-weight: 800;
  letter-spacing: -0.03em;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.stat-lbl {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.panel-footer {
  position: relative;
  z-index: 2;
  font-size: 12px;
  color: var(--text-muted);
}

/* ============ LADO DIREITO: FORM ============ */
.panel-form {
  position: relative;
  background: var(--bg);
  display: grid;
  place-items: center;
  padding: clamp(24px, 4vh, 48px);
  overflow-y: auto;
  min-height: 100dvh;
}

/* Linha decorativa lateral */
.panel-form::before {
  content: '';
  position: absolute;
  left: 0; top: 20%; bottom: 20%;
  width: 1px;
  background: linear-gradient(180deg, transparent, var(--border), transparent);
}

.form-wrap {
  width: 100%;
  max-width: 400px;
}

.form-logo { display: none; margin-bottom: 32px; }
.logo-mini {
  width: 44px; height: 44px;
  border-radius: 11px;
  background: linear-gradient(135deg, var(--accent) 0%, #FF9500 100%);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 17px;
  color: #0A0E10;
  box-shadow: 0 4px 20px -4px var(--accent-glow);
}

.form-title {
  font-size: clamp(26px, 4vh, 34px);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 6px;
}

.form-sub {
  font-size: 14.5px;
  color: var(--text-soft);
  margin-bottom: clamp(28px, 5vh, 40px);
  line-height: 1.5;
}

/* ============ CAMPOS ============ */
.group { margin-bottom: 22px; position: relative; }

.group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-soft);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 8px;
}

.input-shell {
  position: relative;
  display: flex;
  align-items: center;
}

.input-shell .ico {
  position: absolute;
  left: 14px;
  width: 18px;
  height: 18px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color 0.2s;
  z-index: 2;
}

.input-shell input {
  width: 100%;
  height: 52px;
  background: rgba(10, 14, 26, 0.7);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  padding: 0 46px 0 46px;
  font-size: 15px;
  font-family: inherit;
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s, background 0.25s;
}
.input-shell input::placeholder { color: var(--text-muted); }
.input-shell input:hover:not(:focus) { border-color: rgba(148, 163, 184, 0.3); }
.input-shell input:focus {
  border-color: var(--accent);
  background: rgba(10, 14, 26, 0.95);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 20px -4px var(--accent-glow);
}
.input-shell input:focus ~ .ico { color: var(--accent); }

.eye {
  position: absolute;
  right: 8px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  background: transparent;
  border: none;
  border-radius: 8px;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  z-index: 2;
}
.eye:hover { color: var(--text); background: rgba(148,163,184,0.1); }

/* ============ META (lembrar + esqueceu) ============ */
.form-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 28px;
  font-size: 13.5px;
}

.check {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  color: var(--text-soft);
  user-select: none;
}
.check input {
  width: 16px; height: 16px;
  accent-color: var(--accent);
  cursor: pointer;
  border: 1.5px solid var(--border);
  border-radius: 4px;
}
.check span { transition: color 0.2s; }
.check:hover span { color: var(--text); }

.link {
  color: var(--accent);
  text-decoration: none;
  font-weight: 500;
  transition: opacity 0.2s;
}
.link:hover { opacity: 0.8; }

/* ============ BOTÃO ========== */
.btn-login {
  width: 100%;
  height: 54px;
  border: none;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--accent) 0%, var(--accent-hover) 100%);
  color: #0A0E10;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.015em;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: all 0.2s;
  box-shadow: 0 4px 24px -6px var(--accent-glow);
}
.btn-login::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255,255,255,0.3) 50%, transparent 70%);
  transform: translateX(-100%);
  transition: transform 0.5s;
}
.btn-login:hover { transform: translateY(-2px); box-shadow: 0 8px 32px -8px var(--accent-glow); }
.btn-login:hover::after { transform: translateX(100%); }
.btn-login:active { transform: translateY(0) scale(0.99); }
.btn-login:disabled { opacity: 0.6; cursor: wait; transform: none; }

.btn-login .spinner {
  display: none;
  width: 18px; height: 18px;
  border: 2.5px solid rgba(10,14,16,0.25);
  border-top-color: #0A0E10;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -4px;
  margin-right: 8px;
}
.btn-login.loading .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ============ ERRO ========== */
.login-error {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--error-bg);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: #FCA5A5;
  font-size: 13.5px;
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 24px;
  animation: shake 0.4s ease;
}
@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-5px); }
  75% { transform: translateX(5px); }
}

/* ============ RESPONSIVE ============ */
@media (max-width: 900px) {
  .login-split { grid-template-columns: 1fr; }
  .panel-visual { display: none; } /* Mobile: só o form */
  .panel-form { min-height: 100dvh; }
  .form-logo { display: block; }
  .panel-form::before { display: none; }
}

@media (max-height: 720px) {
  .form-title { font-size: 24px; }
  .form-sub { margin-bottom: 20px; }
  .group { margin-bottom: 14px; }
  .input-shell input { height: 48px; }
  .btn-login { height: 48px; }
  .visual-text h1 { font-size: clamp(26px, 4.5vw, 40px); }
  .visual-stats { margin-top: 24px; }
}

@media (max-width: 480px) {
  .panel-form { padding: 24px 20px; }
  .form-title { font-size: 24px; }
}

/* Acessibilidade */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
