/* ─────────────────────────────────────────────────────────────
   e-Faturas — Login Page Styles
   ───────────────────────────────────────────────────────────── */

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

/* ── 1. Reset & Root ──────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --brand-primary: #F59E0B;
  --brand-hover:   #FBBF24;
  --brand-subtle:  rgba(245,158,11,.12);
}

html { font-family: 'Inter', sans-serif; font-size: 16px; }
body { min-height: 100vh; background: #0B0F1A; overflow: hidden; }

/* ── 2. Split Layout ──────────────────────────────────────── */
.login-split {
  display: flex;
  min-height: 100vh;
  width: 100%;
}

/* ══════════════════════════════════════════════════════════
   3. LEFT PANEL
══════════════════════════════════════════════════════════ */
.panel-left {
  position: relative;
  width: 48%;
  min-height: 100vh;
  background: #0B0F1A;
  color: #fff;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── 4. Animated Grid ─────────────────────────────────────── */
.grid-bg {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(245,158,11,.065) 1px, transparent 1px),
    linear-gradient(90deg, rgba(245,158,11,.065) 1px, transparent 1px);
  background-size: 44px 44px;
  animation: gridScroll 20s linear infinite;
}

@keyframes gridScroll {
  from { background-position: 0 0; }
  to   { background-position: 44px 44px; }
}

/* ── 5. Floating Orbs ─────────────────────────────────────── */
.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  pointer-events: none;
  will-change: transform;
}

.orb-1 {
  width: 380px; height: 380px;
  background: radial-gradient(circle, rgba(245,158,11,.30) 0%, transparent 70%);
  top: -100px; left: -80px;
  animation: orbFloat1 9s ease-in-out infinite;
}
.orb-2 {
  width: 320px; height: 320px;
  background: radial-gradient(circle, rgba(251,191,36,.14) 0%, transparent 70%);
  bottom: 5%; right: -60px;
  animation: orbFloat2 11s ease-in-out infinite;
}
.orb-3 {
  width: 220px; height: 220px;
  background: radial-gradient(circle, rgba(251,191,36,.18) 0%, transparent 70%);
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  animation: orbFloat3 13s ease-in-out infinite;
}

@keyframes orbFloat1 {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(35px, 45px); }
}
@keyframes orbFloat2 {
  0%,100% { transform: translate(0,0); }
  50%     { transform: translate(-30px,-40px); }
}
@keyframes orbFloat3 {
  0%,100% { transform: translate(-50%,-50%) scale(1); opacity: .5; }
  50%     { transform: translate(-50%,-56%) scale(1.2); opacity: .85; }
}

/* ── 6. Left Panel Content ────────────────────────────────── */
.panel-left__inner {
  position: relative;
  z-index: 2;
  padding: 3rem 3.5rem;
  max-width: 500px;
  width: 100%;
}

/* Logo */
.logo-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 2.75rem;
}

.site-logo { height: 38px; width: auto; }

.logo-tagline {
  font-size: .7rem;
  font-weight: 400;
  color: rgba(255,255,255,.38);
  letter-spacing: .17em;
  text-transform: uppercase;
}

/* Hero */
.hero { margin-bottom: 2.5rem; }

.hero__title {
  font-family: 'Inter', sans-serif;
  font-size: 2.5rem;
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 1rem;
}

.hero__highlight {
  background: linear-gradient(135deg, #F59E0B 0%, #D97706 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero__sub {
  font-size: .94rem;
  color: rgba(255,255,255,.5);
  line-height: 1.65;
  max-width: 370px;
}

/* Stats bar */
.stats {
  display: inline-flex;
  align-items: center;
  gap: 1.5rem;
  padding: 1.1rem 1.5rem;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.07);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.stat {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.stat__value {
  font-family: 'Inter', sans-serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: #fff;
  line-height: 1;
}
.stat__unit { font-size: .82rem; color: #F59E0B; }
.stat__label {
  font-size: .67rem;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .12em;
}
.stat__divider {
  width: 1px; height: 36px;
  background: rgba(255,255,255,.09);
  flex-shrink: 0;
}

/* ══════════════════════════════════════════════════════════
   7. RIGHT PANEL — Dark theme (default via CSS vars)
══════════════════════════════════════════════════════════ */
.panel-right {
  --rp-bg:           #0F172A;
  --rp-text:         #F8FAFC;
  --rp-muted:        rgba(248,250,252,.46);
  --rp-border:       rgba(255,255,255,.08);
  --rp-input-bg:     #1E293B;
  --rp-input-border: #2D3F55;
  --rp-icon:         rgba(248,250,252,.34);
  --rp-btn-bg:       #1E293B;
  --rp-btn-icon:     #94A3B8;
  --rp-divider:      rgba(255,255,255,.06);
  --rp-footer:       rgba(248,250,252,.26);

  position: relative;
  width: 52%;
  min-height: 100vh;
  background: var(--rp-bg);
  color: var(--rp-text);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 2rem;
  border-left: 1px solid var(--rp-divider);
  transition: background .3s ease, color .3s ease;
}

/* ── 8. Right Panel — Light Theme ────────────────────────── */
.panel-right[data-theme="light"] {
  --rp-bg:           #F1F5F9;
  --rp-text:         #0F172A;
  --rp-muted:        #64748B;
  --rp-border:       #E2E8F0;
  --rp-input-bg:     #FFFFFF;
  --rp-input-border: #CBD5E1;
  --rp-icon:         #94A3B8;
  --rp-btn-bg:       #E2E8F0;
  --rp-btn-icon:     #475569;
  --rp-divider:      #E2E8F0;
  --rp-footer:       #94A3B8;
  /* Brand override para fundo claro */
  --brand-primary:   #B45309;
  --brand-hover:     #D97706;
  --brand-subtle:    rgba(180,83,9,.10);
}

/* ── 9. Theme Toggle ──────────────────────────────────────── */
.theme-toggle {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 40px; height: 40px;
  border-radius: 10px;
  background: var(--rp-btn-bg);
  border: 1px solid var(--rp-border);
  color: var(--rp-btn-icon);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color .2s ease, color .2s ease, background .3s ease;
  flex-shrink: 0;
}
.theme-toggle:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
}
.theme-toggle svg { width: 17px; height: 17px; }

/* Show sun in dark mode, moon in light mode */
.panel-right[data-theme="dark"]  .icon-moon { display: none; }
.panel-right[data-theme="dark"]  .icon-sun  { display: block; }
.panel-right[data-theme="light"] .icon-sun  { display: none; }
.panel-right[data-theme="light"] .icon-moon { display: block; }

/* ── 10. Form Card ────────────────────────────────────────── */
.form-card {
  width: 100%;
  max-width: 400px;
}

.form-logo { margin-bottom: 2rem; }

.form-title {
  font-family: 'Inter', sans-serif;
  font-size: 1.65rem;
  font-weight: 700;
  color: var(--rp-text);
  margin-bottom: .4rem;
  transition: color .3s ease;
}
.form-subtitle {
  font-size: .875rem;
  color: var(--rp-muted);
  margin-bottom: 1.75rem;
  transition: color .3s ease;
}

/* ── 11. Alert ────────────────────────────────────────────── */
.alert {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: .75rem .95rem;
  border-radius: 10px;
  font-size: .84rem;
  line-height: 1.45;
  margin-bottom: 1.25rem;
  animation: alertIn .3s ease both;
}
.alert svg { flex-shrink: 0; margin-top: 1px; }

.alert--error {
  background: rgba(239,68,68,.12);
  border: 1px solid rgba(239,68,68,.22);
  color: #FCA5A5;
}

.alert--success {
  background: rgba(245,158,11,.10);
  border: 1px solid rgba(245,158,11,.22);
  color: #F59E0B;
}

/* ── 12. Fields ───────────────────────────────────────────── */
.field { margin-bottom: 1.1rem; }

.field__label {
  display: block;
  font-size: .8rem;
  font-weight: 500;
  color: var(--rp-muted);
  margin-bottom: .4rem;
  letter-spacing: .02em;
  transition: color .3s ease;
}

.field__wrap { position: relative; }

.field__icon {
  position: absolute;
  left: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px; height: 15px;
  color: var(--rp-icon);
  pointer-events: none;
  transition: color .3s ease;
}

.field__input {
  width: 100%;
  height: 46px;
  padding: 0 42px;
  background: var(--rp-input-bg);
  border: 1.5px solid var(--rp-input-border);
  border-radius: 10px;
  color: var(--rp-text);
  font-family: 'Inter', sans-serif;
  font-size: .9rem;
  outline: none;
  -webkit-appearance: none;
  transition: border-color .2s ease, box-shadow .2s ease,
              background .3s ease, color .3s ease;
}
.field__input::placeholder { color: var(--rp-icon); }
.field__input:focus {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(245,158,11,.14);
}

.field__eye {
  position: absolute;
  right: 11px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--rp-icon);
  padding: 5px;
  display: flex;
  align-items: center;
  transition: color .2s ease;
}
.field__eye:hover { color: var(--brand-primary); }
.field__eye svg { width: 15px; height: 15px; }

/* ── 13. Checkbox & Form Row ──────────────────────────────── */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}

.checkbox-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
}
.checkbox-input { display: none; }

.checkbox-custom {
  width: 16px; height: 16px;
  border-radius: 4px;
  border: 1.5px solid var(--rp-input-border);
  background: var(--rp-input-bg);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .15s ease, border-color .15s ease;
}
.checkbox-input:checked + .checkbox-custom {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
}
.checkbox-input:checked + .checkbox-custom::after {
  content: '';
  display: block;
  width: 9px; height: 5px;
  border-left: 2px solid #0B0F1A;
  border-bottom: 2px solid #0B0F1A;
  transform: rotate(-45deg) translateY(-1px);
}

.checkbox-label {
  font-size: .82rem;
  color: var(--rp-muted);
  transition: color .3s ease;
}

.form-link {
  font-size: .82rem;
  color: var(--brand-primary);
  text-decoration: none;
  font-weight: 500;
  transition: opacity .2s ease;
}
.form-link:hover { opacity: .7; text-decoration: underline; }

/* ── 14. Submit Button ────────────────────────────────────── */
.btn-submit {
  width: 100%;
  height: 48px;
  background: var(--brand-primary);
  border: none;
  border-radius: 8px;
  color: #0B0F1A;
  font-family: 'Inter', sans-serif;
  font-size: .93rem;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  letter-spacing: .02em;
  box-shadow: 0 4px 20px rgba(245,158,11,.28);
  transition: background .2s ease, transform .15s ease, box-shadow .2s ease;
}
.btn-submit:hover {
  background: var(--brand-hover);
  transform: translateY(-1px);
  box-shadow: 0 7px 28px rgba(245,158,11,.38);
}
.btn-submit:active  { transform: translateY(0); }
.btn-submit:disabled {
  opacity: .5;
  cursor: not-allowed;
  transform: none;
}
.panel-right[data-theme="light"] .btn-submit { color: #fff; }

.form-footer {
  margin-top: 2rem;
  text-align: center;
  font-size: .72rem;
  color: var(--rp-footer);
  transition: color .3s ease;
}

/* ══════════════════════════════════════════════════════════
   15. Entry Animations
══════════════════════════════════════════════════════════ */
.slide-up {
  animation: slideUp .65s cubic-bezier(.16,1,.3,1) both;
}
.delay-1 { animation-delay: .15s; }
.delay-2 { animation-delay: .3s; }
.delay-3 { animation-delay: .45s; }

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

.slide-right {
  animation: slideRight .65s cubic-bezier(.16,1,.3,1) .08s both;
}
@keyframes slideRight {
  from { opacity: 0; transform: translateX(20px); }
  to   { opacity: 1; transform: translateX(0); }
}

@keyframes alertIn {
  from { opacity: 0; transform: translateY(-5px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════════════════
   16. Responsive
══════════════════════════════════════════════════════════ */
@media (max-width: 900px) {
  body { overflow: auto; }

  .login-split { flex-direction: column; }

  .panel-left {
    width: 100%;
    min-height: auto;
    padding: 3rem 1.5rem 2.5rem;
  }
  .panel-left__inner { padding: 0; }

  .panel-right {
    width: 100%;
    min-height: auto;
    padding: 2.5rem 1.5rem 3rem;
    border-left: none;
    border-top: 1px solid var(--rp-divider);
  }

  .hero__title { font-size: 1.9rem; }
  .stats { gap: 1.1rem; padding: .9rem 1.2rem; }
}

@media (max-width: 480px) {
  .hero__title { font-size: 1.6rem; }
  .badge--more { display: none; }
  .stats .stat__value { font-size: 1.2rem; }
}
