/* Reset */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }

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

:root {
  /* Brand XFRANCHISE */
  --bg: #0A0A0A;
  --surface: #141414;
  --surface-2: #1a1a1a;
  --surface-3: #202020;
  --border: #262626;
  --border-strong: #333333;

  --text: #F2F2F2;
  --text-dim: #B5B5B5;
  --text-mute: #7A7A7A;

  --gold: #BAA05E;
  --gold-light: #D6BF85;
  --gold-deep: #917D3D;
  --gold-bg-soft: rgba(186, 160, 94, 0.08);
  --gold-bg-mid: rgba(186, 160, 94, 0.14);
  --gold-border: rgba(186, 160, 94, 0.25);
  --gold-gradient: linear-gradient(135deg, #D6BF85 0%, #BAA05E 50%, #917D3D 100%);

  --danger: #ef4444;
  --success: #22c55e;
  --warn: #eab308;
  --info: #60a5fa;

  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --shadow: 0 4px 24px rgba(0,0,0,.4);
  --shadow-gold: 0 4px 24px rgba(186, 160, 94, .15);
  --max: 880px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.55;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  background-attachment: fixed;
  position: relative;
  min-height: 100vh;
  /* Camada 1: glow dourado radial no topo */
  background-image:
    radial-gradient(ellipse at top, rgba(186,160,94,.06), transparent 55%);
}
/* Camada 2: padrão de pontos dourados (textura sutil) */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background-image: radial-gradient(rgba(186,160,94,.55) 1px, transparent 1px);
  background-size: 32px 32px;
  opacity: .06;
}
/* Camada 3: vinheta nas bordas */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  background: radial-gradient(ellipse at center, transparent 55%, rgba(0,0,0,.55) 100%);
}
body > *, .topbar, .container, .container-wide, .admin-shell, .login-wrap {
  position: relative;
  z-index: 1;
}

a { color: inherit; text-decoration: none; }

.container {
  max-width: var(--max);
  margin: 0 auto;
  padding: 32px 20px 80px;
}

.container-wide {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 80px;
}

/* Logo */
.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}
.logo-mark {
  width: 38px; height: 38px;
  background: url('/assets/images/logo-x-oficial.png') center / contain no-repeat;
  flex-shrink: 0;
  /* esconde o texto "XF" caso esteja dentro do span */
  font-size: 0;
  color: transparent;
  text-indent: -9999px;
  filter: drop-shadow(0 2px 6px rgba(186, 160, 94, .35));
}
.logo-text {
  font-weight: 700;
  font-size: 16px;
  letter-spacing: .2px;
  color: var(--text);
}
.logo-text small {
  display: block;
  font-weight: 500;
  font-size: 10.5px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  margin-top: 2px;
}

/* Header */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 24px;
  border-bottom: 1px solid var(--border);
  background: rgba(10,10,10,.85);
  position: sticky; top: 0; z-index: 10;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.topbar .brand { font-weight: 700; letter-spacing: .5px; font-size: 13px; text-transform: uppercase; color: var(--text-dim); }

/* Landing */
.hero {
  text-align: left;
  padding: 60px 0 40px;
}
.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold);
  background: var(--gold-bg-soft);
  border: 1px solid var(--gold-border);
  padding: 6px 14px;
  border-radius: 999px;
  margin-bottom: 24px;
  font-weight: 600;
}
.kicker::before {
  content: '';
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

h1 {
  font-size: 44px;
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.025em;
  margin-bottom: 20px;
}
h2 { font-size: 22px; line-height: 1.25; font-weight: 600; margin-bottom: 12px; letter-spacing: -.01em; }
h3 { font-size: 16px; font-weight: 600; margin-bottom: 8px; color: var(--text); }
.lead { font-size: 18px; color: var(--text-dim); max-width: 640px; }
.muted { color: var(--text-mute); font-size: 14px; }

.gold-text { color: var(--gold); }
.gold-gradient-text {
  background: var(--gold-gradient);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.divider { border-top: 1px solid var(--border); margin: 40px 0; }

/* Cards */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px;
  position: relative;
}
.card-gold-edge {
  background: var(--surface);
  border: 1px solid var(--gold-border);
  border-radius: var(--radius);
  padding: 28px;
  box-shadow: var(--shadow-gold);
}

.callout {
  background: var(--gold-bg-soft);
  border: 1px solid var(--gold-border);
  border-left: 3px solid var(--gold);
  padding: 18px 20px;
  border-radius: var(--radius-sm);
  margin: 24px 0;
  color: var(--text-dim);
  font-size: 15px;
}
.callout strong { color: var(--text); }

/* Form */
.form-section { margin-bottom: 32px; }
.form-section-title {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 8px;
}
.section-num {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px;
  border-radius: 8px;
  background: var(--gold-bg-mid);
  border: 1px solid var(--gold-border);
  color: var(--gold);
  font-size: 13px; font-weight: 700;
}
.section-desc { color: var(--text-mute); font-size: 14px; margin-bottom: 20px; }

.field { margin-bottom: 22px; }
.field label.q {
  display: block;
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 10px;
  color: var(--text);
}
.field .hint {
  display: block;
  font-size: 13px;
  color: var(--text-mute);
  margin: 4px 0 10px;
  font-style: italic;
}

input[type="text"], input[type="email"], input[type="tel"], input[type="password"], textarea, select {
  width: 100%;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 15px;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
input::placeholder, textarea::placeholder { color: var(--text-mute); }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--gold);
  background: var(--surface-3);
  box-shadow: 0 0 0 3px var(--gold-bg-mid);
}
textarea { min-height: 110px; resize: vertical; line-height: 1.5; }

/* Radio / checkbox cards */
.options { display: grid; gap: 8px; }
.options.cols-2 { grid-template-columns: 1fr 1fr; }
@media (max-width: 600px) { .options.cols-2 { grid-template-columns: 1fr; } }
.option {
  display: flex; align-items: center; gap: 12px;
  padding: 12px 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
  font-size: 15px;
}
.option:hover { border-color: var(--border-strong); }
.option input { accent-color: var(--gold); width: 16px; height: 16px; cursor: pointer; }
.option input:checked + span { color: var(--text); font-weight: 500; }
.option:has(input:checked) {
  border-color: var(--gold);
  background: var(--gold-bg-soft);
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 15px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform .05s, opacity .15s, background .15s, border-color .15s, box-shadow .15s;
  font-family: inherit;
  letter-spacing: .2px;
}
.btn:active { transform: translateY(1px); }
.btn-primary {
  background: var(--gold-gradient);
  color: #0A0A0A;
  box-shadow: 0 4px 14px rgba(186, 160, 94, .3);
  border: none;
}
.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(186, 160, 94, .4);
  transform: translateY(-1px);
}
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border-strong); }
.btn-ghost:hover { border-color: var(--gold); color: var(--gold); background: var(--gold-bg-soft); }
.btn-danger { background: transparent; color: var(--danger); border-color: var(--border); }
.btn-danger:hover { background: rgba(239,68,68,.08); }

.btn[disabled] { opacity: .5; cursor: not-allowed; transform: none; }
.btn[disabled]:hover { transform: none; box-shadow: none; }

.actions {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 32px; gap: 12px;
}

/* Progress */
.progress-wrap {
  position: sticky; top: 65px; z-index: 9;
  background: rgba(10,10,10,.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  padding: 16px 0;
  margin-bottom: 8px;
}
.progress-bar {
  height: 5px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
}
.progress-fill {
  height: 100%;
  background: var(--gold-gradient);
  width: 0%;
  transition: width .3s ease;
  box-shadow: 0 0 12px rgba(186, 160, 94, .4);
}
.progress-meta {
  display: flex; justify-content: space-between;
  font-size: 12px; color: var(--text-mute);
  margin-top: 8px;
}

/* Step header */
.step-head { margin-bottom: 24px; }
.step-head .eyebrow {
  display: inline-block;
  font-size: 11px; letter-spacing: 2px; text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 12px;
  font-weight: 600;
}

/* Page transitions */
.step { display: none; animation: fade .25s ease; }
.step.active { display: block; }
@keyframes fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* Admin */
.admin-shell { display: grid; grid-template-columns: 240px 1fr; min-height: 100vh; }
@media (max-width: 900px) { .admin-shell { grid-template-columns: 1fr; } }
.sidebar {
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
}
.sidebar h4 { font-size: 11px; letter-spacing: 1.5px; text-transform: uppercase; color: var(--text-mute); margin: 16px 8px 6px; }
.sidebar a {
  display: block; padding: 8px 12px; border-radius: 6px; color: var(--text-dim); font-size: 14px;
  transition: background .15s, color .15s;
}
.sidebar a:hover, .sidebar a.active { background: var(--gold-bg-soft); color: var(--gold); }
.sidebar .logo { padding: 8px; margin-bottom: 16px; }
.main { padding: 28px 32px; }

/* Table */
.table {
  width: 100%; border-collapse: collapse; background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden;
}
.table th, .table td { padding: 14px 16px; text-align: left; font-size: 14px; }
.table th { background: var(--surface-2); color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .5px; border-bottom: 1px solid var(--border); }
.table tr { border-bottom: 1px solid var(--border); transition: background .12s; }
.table tr:last-child { border-bottom: none; }
.table tr:hover td { background: var(--gold-bg-soft); cursor: pointer; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: .5px; border: 1px solid var(--border); }
.badge-pendente { background: rgba(234,179,8,.12); color: #eab308; border-color: rgba(234,179,8,.3); }
.badge-em_analise { background: rgba(96,165,250,.12); color: var(--info); border-color: rgba(96,165,250,.3); }
.badge-concluido { background: rgba(34,197,94,.12); color: var(--success); border-color: rgba(34,197,94,.3); }

.toolbar { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 20px; align-items: center; }
.toolbar input, .toolbar select { width: auto; flex: 0 1 240px; }

.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; margin-bottom: 24px; }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  position: relative;
  overflow: hidden;
}
.stat::after {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--gold-gradient);
  opacity: .6;
}
.stat .v { font-size: 28px; font-weight: 700; letter-spacing: -.02em; }
.stat .l { color: var(--text-mute); font-size: 11px; text-transform: uppercase; letter-spacing: 1.5px; margin-top: 4px; font-weight: 600; }

/* Detail */
.detail-grid { display: grid; gap: 16px; }
.detail-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.detail-section h3 { font-size: 12px; text-transform: uppercase; letter-spacing: 1.5px; color: var(--gold); margin-bottom: 16px; padding-bottom: 12px; border-bottom: 1px solid var(--border); font-weight: 700; }
.kv { display: grid; grid-template-columns: 220px 1fr; gap: 12px 24px; align-items: start; }
@media (max-width: 700px) { .kv { grid-template-columns: 1fr; gap: 4px; } .kv dt { color: var(--text-mute); margin-top: 12px; } }
.kv dt { color: var(--text-mute); font-size: 13px; }
.kv dd { color: var(--text); font-size: 14px; white-space: pre-wrap; }
.kv dd.empty { color: var(--text-mute); font-style: italic; }

/* Toast */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%);
  background: var(--gold-gradient); color: #0A0A0A;
  padding: 12px 22px; border-radius: 10px; font-weight: 600; font-size: 14px;
  box-shadow: var(--shadow-gold);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
  z-index: 999;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.toast.error { background: var(--danger); color: white; box-shadow: 0 4px 24px rgba(239,68,68,.3); }

/* Login */
.login-wrap {
  min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 24px;
  position: relative;
  overflow: hidden;
}
.login-wrap::before {
  content: '';
  position: absolute;
  top: 20%; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(186,160,94,.08), transparent 70%);
  filter: blur(60px);
  z-index: 0;
}
.login-card {
  width: 100%; max-width: 420px;
  position: relative; z-index: 1;
}

/* Success */
.success-icon {
  width: 64px; height: 64px; border-radius: 50%;
  background: var(--gold-bg-mid); color: var(--gold);
  border: 1px solid var(--gold-border);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 24px;
  font-size: 32px;
  font-weight: 700;
}

.spinner {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(10,10,10,.3); border-top-color: #0A0A0A;
  border-radius: 50%; animation: spin .7s linear infinite;
  margin-right: 8px;
}
@keyframes spin { to { transform: rotate(360deg); } }
