/* ============================================================
   Portal do Cliente IA GURU — Estilos Etapa 1
   ============================================================ */

/* Variables */
:root {
  --primary:      #6366f1;
  --primary-dark: #4f46e5;
  --primary-light:#818cf8;
  --accent:       #00d4ff;
  --success:      #10b981;
  --error:        #ef4444;
  --warning:      #f59e0b;

  --bg:           #f8fafc;
  --surface:      #ffffff;
  --border:       #e2e8f0;
  --text:         #1e1b4b;
  --text-muted:   #64748b;
  --text-light:   #94a3b8;

  --radius:       12px;
  --radius-sm:    8px;
  --shadow-sm:    0 1px 3px rgba(0,0,0,.08);
  --shadow-md:    0 4px 24px rgba(99,102,241,.12);
  --shadow-lg:    0 20px 60px rgba(99,102,241,.15);

  --font-heading: 'Syne', sans-serif;
  --font-body:    'DM Sans', sans-serif;
}

/* Dark mode prep */
[data-theme="dark"] {
  --bg:       #07070f;
  --surface:  #0d0d1f;
  --border:   rgba(99,102,241,.2);
  --text:     #f0f0f0;
  --text-muted:#94a3b8;
}

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

html { font-size: 16px; scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; transition: color .2s; }
a:hover { color: var(--primary-dark); }

img { max-width: 100%; height: auto; display: block; }

/* ============================================================
   AUTH LAYOUT
   ============================================================ */
.auth-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 100vh;
}

.auth-layout--centered {
  grid-template-columns: 1fr;
  place-items: center;
  padding: 2rem 1rem;
}

/* Brand panel (esquerdo) */
.auth-brand {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 40%, #0d0d1f 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem;
  position: relative;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  width: 400px; height: 400px;
  background: radial-gradient(circle, rgba(99,102,241,.3) 0%, transparent 70%);
  top: -100px; right: -100px;
  border-radius: 50%;
}

.auth-brand::after {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(0,212,255,.15) 0%, transparent 70%);
  bottom: -80px; left: -80px;
  border-radius: 50%;
}

.auth-brand-inner {
  position: relative;
  z-index: 1;
  text-align: center;
  max-width: 360px;
}

.brand-logo {
  width: 120px;
  margin: 0 auto 1.5rem;
  filter: brightness(0) invert(1);
}

.brand-title {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: .75rem;
  line-height: 1.2;
}

.brand-subtitle {
  color: rgba(255,255,255,.6);
  font-size: .95rem;
  line-height: 1.6;
  margin-bottom: 2rem;
}

.brand-dots {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.brand-dots span {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--primary-light);
  opacity: .5;
  animation: pulse-dot 2s ease-in-out infinite;
}
.brand-dots span:nth-child(2) { animation-delay: .4s; background: var(--accent); }
.brand-dots span:nth-child(3) { animation-delay: .8s; }

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: .5; }
  50%       { transform: scale(1.4); opacity: 1; }
}

/* Form panel (direito) */
.auth-form-area {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem 1.5rem;
  background: var(--bg);
}

.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  padding: 2.5rem;
  border: 1px solid var(--border);
}

.auth-layout--centered .auth-card {
  max-width: 440px;
}

.auth-card-header {
  text-align: center;
  margin-bottom: 2rem;
}

.card-logo-mobile {
  width: 80px;
  margin: 0 auto 1rem;
  display: none;
}

.auth-card-header h2 {
  font-family: var(--font-heading);
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .35rem;
}

.auth-card-header p {
  color: var(--text-muted);
  font-size: .9rem;
}

/* Alerts */
.alert {
  display: flex;
  align-items: flex-start;
  gap: .6rem;
  padding: .85rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  margin-bottom: 1.25rem;
  line-height: 1.4;
}

.alert svg { width: 18px; height: 18px; flex-shrink: 0; margin-top: 1px; }

.alert-error {
  background: #fef2f2;
  color: #b91c1c;
  border: 1px solid #fecaca;
}

.alert-info {
  background: #eff6ff;
  color: #1e40af;
  border: 1px solid #bfdbfe;
}

/* Form elements */
.auth-form { display: flex; flex-direction: column; gap: 1.1rem; }

.form-group { display: flex; flex-direction: column; gap: .4rem; }

.form-group label {
  font-size: .8rem;
  font-weight: 600;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: .05em;
}

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

.input-icon {
  position: absolute;
  left: .9rem;
  width: 18px; height: 18px;
  color: var(--text-light);
  pointer-events: none;
  flex-shrink: 0;
}

.input-wrapper input {
  width: 100%;
  padding: .75rem 1rem .75rem 2.6rem;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--text);
  background: var(--bg);
  transition: border-color .2s, box-shadow .2s;
  outline: none;
}

.input-wrapper input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(99,102,241,.15);
  background: var(--surface);
}

.input-wrapper input::placeholder { color: var(--text-light); }

/* Toggle senha */
.toggle-senha {
  position: absolute;
  right: .75rem;
  background: none;
  border: none;
  cursor: pointer;
  padding: .25rem;
  color: var(--text-light);
  display: flex;
  align-items: center;
  transition: color .2s;
}
.toggle-senha:hover { color: var(--primary); }
.toggle-senha svg { width: 18px; height: 18px; }

/* Checkbox + link row */
.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: .5rem;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: .5rem;
  cursor: pointer;
  font-size: .875rem;
  color: var(--text-muted);
  user-select: none;
}

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

.checkbox-custom {
  width: 18px; height: 18px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  transition: all .2s;
  flex-shrink: 0;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--primary);
  border-color: var(--primary);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid white;
  border-top: none;
  border-left: none;
  transform: rotate(45deg) translateY(-1px);
}

.link-forgot {
  font-size: .875rem;
  color: var(--primary);
  font-weight: 500;
}
.link-forgot:hover { color: var(--primary-dark); }

/* Botão primário */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  width: 100%;
  padding: .9rem 1.5rem;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  color: white;
  font-family: var(--font-heading);
  font-size: .95rem;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform .15s, box-shadow .15s;
  letter-spacing: .02em;
  margin-top: .5rem;
}

.btn-primary svg { width: 18px; height: 18px; }
.btn-primary:hover { transform: translateY(-1px); box-shadow: 0 6px 20px rgba(99,102,241,.4); }
.btn-primary:active { transform: translateY(0); }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Voltar */
.auth-back {
  text-align: center;
  margin-top: 1.5rem;
  font-size: .875rem;
}
.auth-back a { color: var(--text-muted); }
.auth-back a:hover { color: var(--primary); }

/* ============================================================
   PORTAL LAYOUT (welcome page)
   ============================================================ */
.portal-layout {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.portal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.portal-logo { width: 100px; }

.portal-header-actions {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.portal-user {
  font-size: .875rem;
  color: var(--text-muted);
  font-weight: 500;
}

.logout-form { margin: 0; }

.btn-logout {
  display: flex;
  align-items: center;
  gap: .4rem;
  padding: .5rem 1rem;
  background: transparent;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text-muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: var(--font-body);
  text-decoration: none;
}
.btn-logout svg { width: 16px; height: 16px; }
.btn-logout:hover { border-color: var(--error); color: var(--error); }

.portal-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
}

.welcome-card {
  text-align: center;
  max-width: 540px;
  background: var(--surface);
  border-radius: var(--radius);
  padding: 3rem 2rem;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
}

.welcome-icon {
  width: 72px; height: 72px;
  background: linear-gradient(135deg, rgba(99,102,241,.1), rgba(0,212,255,.1));
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--primary);
}
.welcome-icon svg { width: 36px; height: 36px; }

.welcome-card h1 {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: .75rem;
}

.welcome-card p {
  color: var(--text-muted);
  font-size: 1rem;
  margin-bottom: .5rem;
}

.welcome-sub {
  font-size: .875rem !important;
  color: var(--text-light) !important;
  margin-top: 1rem !important;
  padding: 1rem;
  background: var(--bg);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
}

/* ============================================================
   RESPONSIVO
   ============================================================ */
@media (max-width: 768px) {
  .auth-layout {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .card-logo-mobile {
    display: block;
  }

  .auth-form-area {
    padding: 1.5rem 1rem;
    align-items: flex-start;
    padding-top: 2rem;
  }

  .auth-card {
    padding: 1.75rem 1.25rem;
    box-shadow: none;
    border: none;
    background: transparent;
    max-width: 100%;
  }

  .portal-header {
    padding: .75rem 1rem;
  }

  .portal-logo { width: 80px; }
}

@media (max-width: 480px) {
  .form-row {
    flex-direction: column;
    align-items: flex-start;
  }
}
