/* Auvion Portal — reaproveita o design system da landing (branco + #15C462 + Inter) */

:root {
  --color-primary: #15C462;
  --color-primary-dark: #10a052;
  --color-primary-soft: #e6faee;
  --color-primary-ghost: rgba(21,196,98,.08);
  --color-wa: #25D366;
  --color-warn: #d97706;
  --color-warn-soft: #fef3c7;
  --color-danger: #dc2626;
  --color-danger-soft: #fee2e2;
  --color-info: #2563eb;
  --color-info-soft: #dbeafe;
  --bg: #ffffff;
  --bg-muted: #f6f8f7;
  --text: #1a1f1b;
  --text-secondary: #4a5650;
  --text-muted: #7a857e;
  --text-faint: #a8b0aa;
  --border: #e4eae6;
  --border-soft: #edf1ee;
  --border-hover: #d0d8d3;
  --radius: 12px;
  --radius-md: 16px;
  --shadow-sm: 0 1px 2px rgba(16,24,20,.04);
  --shadow: 0 1px 2px rgba(16,24,20,.04), 0 4px 24px rgba(16,24,20,.06);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: var(--text);
  background: var(--bg-muted);
  -webkit-font-smoothing: antialiased;
  line-height: 1.55;
}

a { color: var(--color-primary-dark); text-decoration: none; }
a:hover { text-decoration: underline; }
strong { font-weight: 700; }

/* ===== Botões (compartilhado) ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 22px;
  font-size: 0.95rem;
  font-weight: 700;
  border-radius: var(--radius);
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: all .15s ease;
  letter-spacing: -0.01em;
  font-family: inherit;
}
.btn-full { width: 100%; }
.btn-lg { padding: 14px 28px; font-size: 1rem; }
.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-dark); text-decoration: none; transform: translateY(-1px); }
.btn-secondary { background: var(--bg); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-muted); border-color: var(--border-hover); text-decoration: none; }
.btn-wa { background: var(--color-wa); color: #fff; }
.btn-wa:hover { background: #1faa54; text-decoration: none; transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text-secondary); border-color: var(--border); }
.btn-ghost:hover { background: var(--bg-muted); text-decoration: none; }

/* ===== Página de login / erro (auth-wrap) ===== */
.auth-wrap {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
  background: radial-gradient(circle at 20% 10%, #e8faef, transparent 40%), radial-gradient(circle at 85% 90%, #e8faef, transparent 40%), var(--bg-muted);
}
.auth-card {
  width: 100%;
  max-width: 420px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 40px 36px;
  box-shadow: var(--shadow);
  text-align: center;
}
.auth-brand { display: inline-block; margin-bottom: 16px; }
.auth-brand img { display: block; }
.auth-title {
  margin: 0 0 6px;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.auth-sub {
  margin: 0 0 28px;
  color: var(--text-secondary);
  font-size: 0.95rem;
}
.auth-error {
  margin: 0 0 20px;
  padding: 12px 16px;
  background: var(--color-danger-soft);
  color: #991b1b;
  border-radius: var(--radius);
  font-size: 0.9rem;
  font-weight: 600;
}
.auth-form { text-align: left; }
.auth-foot {
  margin: 18px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
  text-align: center;
}
.auth-help {
  margin: 24px 0 0;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.auth-help a { color: var(--color-primary-dark); }

.auth-sent-icon {
  display: flex;
  justify-content: center;
  margin-bottom: 16px;
}

.auth-tips {
  margin-top: 20px;
  padding: 14px 16px;
  background: var(--bg-muted);
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-align: left;
}
.auth-tips p { margin: 0; line-height: 1.5; }
.auth-tips a { color: var(--color-primary-dark); }

/* ===== Form fields ===== */
.field {
  display: block;
  margin: 0 0 16px;
}
.field-label {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.field input {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}
.field input:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ghost);
}

/* ===== Topbar do portal ===== */
.topbar {
  position: sticky;
  top: 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  z-index: 10;
}
.topbar-inner {
  max-width: 960px;
  margin: 0 auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.topbar-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1rem;
  color: var(--text);
  text-decoration: none;
}
.topbar-brand:hover { text-decoration: none; }
.topbar-brand span { letter-spacing: -0.01em; }
.topbar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 0.9rem;
}
.topbar-user { color: var(--text-secondary); font-weight: 500; }
.topbar-logout { color: var(--text-muted); font-weight: 500; }

/* ===== Main ===== */
.portal-main {
  padding: 32px 16px 60px;
}
.portal-container {
  max-width: 720px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.portal-narrow { max-width: 560px; }
.portal-h1 {
  margin: 0;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.portal-lead {
  margin: -8px 0 0;
  color: var(--text-secondary);
  font-size: 1rem;
}
.back-link {
  display: inline-block;
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 4px;
}
.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 4px;
}

/* ===== Status card ===== */
.status-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 18px 20px;
  border-radius: var(--radius);
  border: 1.5px solid;
}
.status-card h2 { margin: 0 0 4px; font-size: 1.05rem; font-weight: 800; letter-spacing: -0.01em; }
.status-card p { margin: 0; font-size: 0.9rem; }
.status-icon {
  font-size: 1.4rem;
  line-height: 1;
  flex-shrink: 0;
  padding-top: 2px;
}
.status-card--ok { background: var(--color-primary-soft); border-color: #a8ebc5; color: #065f46; }
.status-card--ok h2 { color: #065f46; }
.status-card--info { background: var(--color-info-soft); border-color: #a5c4ff; color: #1e3a8a; }
.status-card--info h2 { color: #1e3a8a; }
.status-card--warn { background: var(--color-warn-soft); border-color: #fcd34d; color: #78350f; }
.status-card--warn h2 { color: #78350f; }
.status-card--danger { background: var(--color-danger-soft); border-color: #fca5a5; color: #7f1d1d; }
.status-card--danger h2 { color: #7f1d1d; }

/* ===== Plan detail ===== */
.plan-detail {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 24px 26px;
  box-shadow: var(--shadow-sm);
}
.plan-detail-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 18px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border-soft);
}
.plan-detail-head h2 {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.plan-detail-price { text-align: right; }
.plan-detail-price strong {
  display: block;
  font-size: 1.4rem;
  font-weight: 800;
  color: var(--text);
}
.plan-detail-price small { color: var(--text-muted); font-size: 0.8rem; }

.plan-specs {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px 24px;
  margin: 0;
}
.plan-specs > div { margin: 0; }
.plan-specs dt {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 2px;
}
.plan-specs dd {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--text);
}

/* ===== Actions ===== */
.actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ===== Help card ===== */
.help-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 20px 24px;
}
.help-card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: -0.01em;
}
.help-card p {
  margin: 0 0 14px;
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.help-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}
.help-card--highlighted {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
}
.help-card--highlighted p { color: var(--text-secondary); }

/* ===== Trocar plano (plan-switch) ===== */
.plan-switch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin: 0 0 20px;
}
.plan-switch-opt { position: relative; cursor: pointer; }
.plan-switch-opt input { position: absolute; opacity: 0; pointer-events: none; }
.plan-switch-card {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 14px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  transition: all .15s ease;
  position: relative;
  text-align: center;
  min-height: 200px;
}
.plan-switch-opt:hover .plan-switch-card { border-color: var(--border-hover); }
.plan-switch-opt input:checked + .plan-switch-card {
  border-color: var(--color-primary);
  background: var(--color-primary-ghost);
  box-shadow: 0 0 0 3px rgba(21, 196, 98, 0.12);
}
.plan-switch-opt--current .plan-switch-card {
  background: var(--bg-muted);
  border-color: var(--border-soft);
  opacity: 0.85;
}
.plan-switch-opt--current .plan-switch-card:hover { cursor: not-allowed; }
.plan-switch-name { font-size: 0.95rem; font-weight: 800; color: var(--text); letter-spacing: -0.01em; }
.plan-switch-price {
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--text);
}
.plan-switch-price small { font-size: 0.75rem; font-weight: 500; color: var(--text-muted); }
.plan-switch-list {
  list-style: none;
  padding: 0;
  margin: 6px 0 0;
  font-size: 0.78rem;
  color: var(--text-secondary);
  line-height: 1.6;
  text-align: left;
}
.plan-switch-list li::before {
  content: "✓";
  color: var(--color-primary);
  font-weight: 800;
  margin-right: 6px;
}
.plan-switch-flag {
  position: absolute;
  top: -9px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 0.6rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  background: var(--text);
  color: #fff;
  padding: 3px 10px;
  border-radius: var(--radius-pill);
}

@media (max-width: 640px) {
  .plan-switch-grid { grid-template-columns: 1fr; }
  .plan-switch-card { min-height: auto; }
}

/* ===== Cancelar ===== */
.cancel-form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.95rem;
  font-family: inherit;
  background: var(--bg);
  color: var(--text);
  resize: vertical;
  min-height: 90px;
}
.cancel-form textarea:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px var(--color-primary-ghost);
}
.cancel-notice {
  margin: 18px 0;
  padding: 14px 16px;
  background: #fff8e6;
  border: 1px solid #f5e4b0;
  border-radius: var(--radius);
  font-size: 0.85rem;
  color: #7a5b10;
  line-height: 1.5;
}

/* ===== Widget WhatsApp flutuante (igual à landing) ===== */
.wa-float {
  position: fixed;
  bottom: 20px;
  right: 20px;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--color-wa);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 18px rgba(37,211,102,.35), 0 2px 6px rgba(0,0,0,.12);
  z-index: 100;
  transition: transform .2s ease, box-shadow .2s ease;
  text-decoration: none;
}
.wa-float:hover {
  transform: scale(1.06);
  box-shadow: 0 10px 26px rgba(37,211,102,.45), 0 4px 10px rgba(0,0,0,.15);
  text-decoration: none;
}
.wa-float svg { width: 30px; height: 30px; }

/* ===== Mobile ===== */
@media (max-width: 640px) {
  .auth-card { padding: 32px 24px; }
  .portal-main { padding: 24px 12px 48px; }
  .topbar-inner { padding: 12px 16px; }
  .topbar-user { display: none; }
  .plan-detail-head { flex-direction: column; gap: 8px; }
  .plan-detail-price { text-align: left; }
  .plan-specs { grid-template-columns: 1fr; }
  .actions { flex-direction: column; }
  .actions .btn { width: 100%; }
  .wa-float { bottom: 16px; right: 16px; width: 52px; height: 52px; }
  .wa-float svg { width: 28px; height: 28px; }
}
