/* ================================================================
   AUTH PREMIUM — Tema Claro com Split-Panel
   CRM Consórcio
   ================================================================ */

@import url('https://fonts.googleapis.com/css2?family=Inter:ital,wght@0,300;0,400;0,500;0,600;0,700;0,800;0,900;1,400&display=swap');

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

:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --purple:       #8b5cf6;
  --success:      #10b981;
  --danger:       #ef4444;
  --text:         #0f172a;
  --text-sub:     #64748b;
  --text-muted:   #94a3b8;
  --border:       #e2e8f0;
  --bg:           #f8fafc;
  --white:        #ffffff;
  --radius:       12px;
  --radius-lg:    20px;
}

html, body {
  height: 100%;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
}

/* ---- Background ---- */
.auth-body {
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  overflow: hidden;
}

.auth-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.auth-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.35;
}

.orb-1 {
  width: 800px; height: 800px;
  background: radial-gradient(circle, rgba(99,102,241,0.4), transparent 70%);
  top: -300px; right: -200px;
  animation: orbDrift 12s ease-in-out infinite alternate;
}

.orb-2 {
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(139,92,246,0.35), transparent 70%);
  bottom: -200px; left: -150px;
  animation: orbDrift 15s ease-in-out infinite alternate-reverse;
}

.orb-3 {
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(56,189,248,0.3), transparent 70%);
  top: 50%; left: 40%;
  transform: translate(-50%, -50%);
  animation: orbDrift 10s ease-in-out infinite alternate;
  animation-delay: -5s;
}

@keyframes orbDrift {
  from { transform: translateY(0) translateX(0) scale(1); }
  to   { transform: translateY(-40px) translateX(20px) scale(1.05); }
}

.auth-grid {
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(99,102,241,0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(99,102,241,0.04) 1px, transparent 1px);
  background-size: 48px 48px;
}

/* ---- Split Layout ---- */
.auth-split {
  position: relative;
  z-index: 10;
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

/* ---- Left Panel ---- */
.auth-panel-left {
  background: linear-gradient(145deg, #0f172a 0%, #1e1b4b 60%, #1a0e3a 100%);
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 48px;
}

.auth-panel-left::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 20%, rgba(99,102,241,0.25) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(139,92,246,0.2) 0%, transparent 60%);
}

.panel-inner {
  position: relative;
  z-index: 1;
  max-width: 400px;
  width: 100%;
}

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

.logo-icon {
  width: 44px; height: 44px;
  background: linear-gradient(135deg, var(--primary), var(--purple));
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 20px;
  box-shadow: 0 8px 20px rgba(99,102,241,0.4);
}

.logo-text {
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
}

.panel-hero {
  margin-bottom: 48px;
}

.hero-title {
  font-size: clamp(32px, 3.5vw, 42px);
  font-weight: 900;
  color: #fff;
  line-height: 1.15;
  letter-spacing: -0.03em;
  margin-bottom: 20px;
}

.hero-accent {
  background: linear-gradient(135deg, #818cf8, #c084fc);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.hero-desc {
  font-size: 15px;
  color: rgba(255,255,255,0.55);
  line-height: 1.7;
  font-weight: 400;
  max-width: 320px;
}

.panel-stats {
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 20px 24px;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  backdrop-filter: blur(12px);
}

.stat-item { text-align: center; }
.stat-value { display: block; font-size: 20px; font-weight: 800; color: #fff; letter-spacing: -0.02em; }
.stat-label { display: block; font-size: 11px; color: rgba(255,255,255,0.45); font-weight: 500; margin-top: 2px; text-transform: uppercase; letter-spacing: 0.05em; }
.stat-divider { width: 1px; height: 36px; background: rgba(255,255,255,0.1); }

/* Floating cards decorativas */
.float-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 18px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: 14px;
  backdrop-filter: blur(16px);
  color: #fff;
}

.float-card i { font-size: 22px; }
.fc-label { font-size: 11px; color: rgba(255,255,255,0.5); font-weight: 500; }
.fc-val   { font-size: 15px; font-weight: 700; color: #fff; }
.text-indigo { color: #818cf8; }
.text-green  { color: #34d399; }

.card-a {
  top: 12%;
  right: -24px;
  animation: floatA 6s ease-in-out infinite;
}

.card-b {
  bottom: 18%;
  right: -16px;
  animation: floatB 7s ease-in-out infinite;
  animation-delay: -2s;
}

@keyframes floatA {
  0%, 100% { transform: translateY(0) rotate(-1deg); }
  50%       { transform: translateY(-10px) rotate(0deg); }
}

@keyframes floatB {
  0%, 100% { transform: translateY(0) rotate(1deg); }
  50%       { transform: translateY(10px) rotate(0deg); }
}

/* ---- Right Panel ---- */
.auth-panel-right {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 48px 40px;
  background: rgba(255,255,255,0.7);
  backdrop-filter: blur(20px);
}

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

/* Error Alert */
.alert-error {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 18px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  border-left: 4px solid var(--danger);
  border-radius: var(--radius);
  color: #b91c1c;
  font-size: 14px;
  font-weight: 500;
  margin-bottom: 24px;
}

/* Login Form Header */
.login-header {
  margin-bottom: 36px;
}

.login-header h2 {
  font-size: 28px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.03em;
  margin-bottom: 6px;
}

.login-header p {
  font-size: 14px;
  color: var(--text-sub);
  font-weight: 400;
}

/* Field Group */
.field-group {
  margin-bottom: 20px;
}

.field-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.field-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.forgot-link {
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
  text-decoration: none;
  transition: color 0.2s;
}

.forgot-link:hover { color: var(--purple); }

.field-wrap {
  position: relative;
}

.field-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  font-size: 14px;
  pointer-events: none;
  z-index: 1;
}

.field-input {
  width: 100%;
  padding: 13px 44px;
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 14px;
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
  -webkit-appearance: none;
  appearance: none;
}

.field-input::placeholder {
  color: var(--text-muted);
  font-weight: 400;
}

.field-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(99,102,241,0.1);
}

.field-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 6px;
  border-radius: 6px;
  transition: color 0.2s, background 0.2s;
  font-size: 14px;
  line-height: 1;
}

.field-toggle:hover { color: var(--primary); background: rgba(99,102,241,0.06); }
.field-toggle.active { color: var(--primary); }

/* Remember */
.remember-row {
  margin-bottom: 28px;
}

.check-wrap {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  user-select: none;
}

.check-wrap input[type="checkbox"] {
  display: none;
}

.check-box {
  width: 18px;
  height: 18px;
  border: 2px solid #cbd5e1;
  border-radius: 6px;
  background: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
  flex-shrink: 0;
  position: relative;
}

.check-wrap input:checked + .check-box {
  background: var(--primary);
  border-color: var(--primary);
  box-shadow: 0 2px 8px rgba(99,102,241,0.3);
}

.check-wrap input:checked + .check-box::after {
  content: '';
  width: 5px;
  height: 9px;
  border: 2px solid #fff;
  border-top: none;
  border-left: none;
  transform: rotate(45deg);
  margin-top: -2px;
}

.check-text {
  font-size: 13px;
  color: var(--text-sub);
  font-weight: 500;
}

/* Submit Button */
.btn-login {
  width: 100%;
  padding: 15px 24px;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border: none;
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-family: 'Inter', sans-serif;
  font-weight: 600;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  position: relative;
  overflow: hidden;
  transition: all 0.25s ease;
  box-shadow: 0 4px 16px rgba(99,102,241,0.3);
  letter-spacing: 0.01em;
}

.btn-login::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, var(--primary-dark), #3730a3);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.btn-login:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,0.4); }
.btn-login:hover::before { opacity: 1; }
.btn-login:active { transform: translateY(0); }

.btn-login:disabled { opacity: 0.75; cursor: not-allowed; transform: none; }

.btn-label { position: relative; }
.btn-arrow { position: relative; font-size: 13px; transition: transform 0.2s; }
.btn-login:not(.loading):hover .btn-arrow { transform: translateX(3px); }

.btn-loading { display: none; align-items: center; gap: 8px; position: relative; }
.btn-login.loading .btn-label,
.btn-login.loading .btn-arrow { display: none; }
.btn-login.loading .btn-loading { display: flex; }

.spinner {
  width: 18px; height: 18px;
  animation: spin 0.8s linear infinite;
}

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

/* ---- Responsivo ---- */
@media (max-width: 900px) {
  .auth-split {
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr;
  }

  .auth-panel-left {
    padding: 40px 32px 36px;
    min-height: auto;
  }

  .float-card { display: none; }
  .hero-title { font-size: 26px; }
  .panel-logo { margin-bottom: 32px; }
  .panel-hero { margin-bottom: 28px; }

  .auth-panel-right {
    padding: 40px 24px 56px;
  }
}

@media (max-width: 480px) {
  .auth-panel-left { display: none; }
  .auth-panel-right {
    min-height: 100vh;
    padding: 40px 24px;
    background: var(--bg);
  }
  .form-container {
    max-width: 100%;
  }
}
