/* =========================================================================
   GRAND FANTASIA — Template do site do servidor
   Sistema de design: "Grimório Arcano"
   Fundo violeta profundo + ouro rúnico + brilho espírita (teal)
   Display: Cinzel · Corpo: Manrope · Dados/números: JetBrains Mono
   ========================================================================= */

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

:root {
  /* Cores */
  --bg: #14101f;
  --bg-alt: #1b1530;
  --surface: #211a38;
  --surface-alt: #2a2244;
  --border: #3a2f5c;
  --border-soft: #2a2244;

  --gold: #d4af5d;
  --gold-bright: #f0d38a;
  --gold-dim: #8a713a;

  --teal: #4fd6c4;
  --teal-dim: #2c7d72;

  --text: #ede7f6;
  --text-dim: #a99fc4;
  --text-faint: #726892;

  --danger: #e2574c;
  --success: #6fcf97;

  /* Tipografia */
  --font-display: 'Cinzel', 'Georgia', serif;
  --font-body: 'Manrope', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', 'Consolas', monospace;

  /* Layout */
  --container: 1180px;
  --radius: 10px;
  --radius-sm: 6px;

  --shadow-glow-gold: 0 0 0 1px rgba(212,175,93,.25), 0 8px 24px rgba(0,0,0,.45);
  --shadow-glow-teal: 0 0 24px rgba(79,214,196,.35);
  --shadow-card: 0 10px 30px rgba(0,0,0,.35);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    radial-gradient(1200px 600px at 15% -10%, rgba(79,214,196,.08), transparent 60%),
    radial-gradient(1000px 500px at 100% 0%, rgba(212,175,93,.07), transparent 55%),
    var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

main { flex: 1; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: .01em;
  color: var(--gold-bright);
  margin: 0 0 .5em;
}

h1 { font-size: clamp(2rem, 4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 3vw, 2.1rem); }
h3 { font-size: 1.25rem; }

p { color: var(--text-dim); }

a { color: var(--teal); text-decoration: none; }
a:hover { color: var(--gold-bright); }

.mono { font-family: var(--font-mono); }

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

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

/* Foco visível (acessibilidade) */
:focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 3px;
  border-radius: 4px;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Divisor rúnico (elemento assinatura) ---------- */
.rune-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0 auto 40px;
  max-width: 420px;
  color: var(--gold-dim);
}
.rune-divider::before,
.rune-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold-dim), transparent);
}
.rune-divider svg { width: 22px; height: 22px; flex-shrink: 0; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 12px;
}
.eyebrow::before {
  content: '';
  width: 6px; height: 6px;
  background: var(--teal);
  transform: rotate(45deg);
  box-shadow: var(--shadow-glow-teal);
}

/* ---------- Botões ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: .92rem;
  padding: 12px 22px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease, border-color .15s ease;
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }

.btn-primary {
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: #201607;
  box-shadow: 0 4px 16px rgba(212,175,93,.25);
}
.btn-primary:hover { box-shadow: 0 6px 22px rgba(212,175,93,.4); color: #201607; }

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text);
}
.btn-ghost:hover { border-color: var(--teal); color: var(--teal); }

.btn-teal {
  background: linear-gradient(180deg, #6fe9d8, var(--teal));
  color: #062821;
  box-shadow: 0 4px 16px rgba(79,214,196,.25);
}
.btn-teal:hover { color: #062821; box-shadow: 0 6px 22px rgba(79,214,196,.4); }

.btn-sm { padding: 8px 14px; font-size: .82rem; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Header / navegação ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(20, 16, 31, .85);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-soft);
}
.site-header .container {
  display: flex;
  align-items: center;
  gap: 24px;
  height: 74px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--gold-bright);
  flex-shrink: 0;
}
.brand .brand-mark {
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--gold-dim);
  border-radius: 50%;
  color: var(--gold);
  background: radial-gradient(circle at 35% 30%, rgba(212,175,93,.25), transparent 70%);
}
.brand .brand-mark svg { width: 18px; height: 18px; }

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1;
}
.nav-links a {
  color: var(--text-dim);
  font-size: .8rem;
  font-weight: 600;
  padding: 7px 9px;
  border-radius: var(--radius-sm);
  position: relative;
  white-space: nowrap;
}
.nav-links a:hover { color: var(--text); background: var(--surface); }
.nav-links a.active { color: var(--gold-bright); }
.nav-links a.active::after {
  content: '';
  position: absolute;
  left: 12px; right: 12px; bottom: 2px;
  height: 2px;
  background: var(--gold);
  box-shadow: 0 0 8px var(--gold);
}

.nav-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.icon-link {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--text-dim);
  transition: all .15s ease;
}
.icon-link svg { width: 18px; height: 18px; }
.icon-link:hover { color: var(--teal); border-color: var(--teal); box-shadow: var(--shadow-glow-teal); }

.nav-toggle {
  display: none;
  background: none; border: 1px solid var(--border);
  color: var(--text); border-radius: var(--radius-sm);
  width: 40px; height: 40px; cursor: pointer;
}

.user-chip {
  display: flex;
  align-items: center;
  color: var(--text);
  gap: 8px;
  padding: 6px 12px 6px 6px;
  border: 1px solid var(--border);
  border-radius: 999px;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text);
}
.user-chip .avatar {
  width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal), var(--gold));
}

@media (max-width: 1240px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
  .site-header.menu-open .nav-links {
    display: flex;
    flex-direction: column;
    position: absolute;
    top: 74px; left: 0; right: 0;
    background: var(--bg-alt);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px 18px;
  }
}

/* ---------- Footer ---------- */
.site-footer {
  border-top: 1px solid var(--border-soft);
  background: var(--bg-alt);
  margin-top: 80px;
  padding: 48px 0 26px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 32px;
  margin-bottom: 32px;
}
.footer-grid h4 {
  font-family: var(--font-body);
  color: var(--text);
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  margin-bottom: 14px;
}
.footer-grid ul { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: 8px; }
.footer-grid a { color: var(--text-dim); font-size: .9rem; }
.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 12px;
  padding-top: 22px;
  border-top: 1px solid var(--border-soft);
  font-size: .8rem;
  color: var(--text-faint);
}
.footer-social { display: flex; gap: 10px; }
@media (max-width: 760px) { .footer-grid { grid-template-columns: 1fr 1fr; } }

/* ---------- Cards genéricos ---------- */
.card {
  background: linear-gradient(180deg, var(--surface), var(--surface-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.stat-card { text-align: center; }
.stat-card .stat-value {
  font-family: var(--font-mono);
  font-size: 2.1rem;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1;
}
.stat-card .stat-label {
  margin-top: 8px;
  font-size: .78rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--text-faint);
}

/* ---------- Formulários ---------- */
.field { margin-bottom: 16px; text-align: left; }
.field label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--text-dim);
  margin-bottom: 6px;
}
.field input, .field select {
  width: 100%;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 11px 13px;
  border-radius: var(--radius-sm);
  font-family: var(--font-body);
  font-size: .92rem;
  transition: border-color .15s ease;
}
.field input:focus, .field select:focus { border-color: var(--teal); outline: none; }
.field-hint { font-size: .75rem; color: var(--text-faint); margin-top: 5px; }
.field-error { font-size: .75rem; color: var(--danger); margin-top: 5px; display: none; }
.field.has-error input { border-color: var(--danger); }
.field.has-error .field-error { display: block; }

.form-divider {
  display: flex; align-items: center; gap: 12px;
  color: var(--text-faint); font-size: .78rem; margin: 18px 0;
}
.form-divider::before, .form-divider::after { content: ''; flex: 1; height: 1px; background: var(--border); }

/* ---------- Toast / alertas ---------- */
.alert {
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  font-size: .85rem;
  border: 1px solid;
  margin-bottom: 14px;
}
.alert-info { background: rgba(79,214,196,.08); border-color: var(--teal-dim); color: var(--teal); }
.alert-danger { background: rgba(226,87,76,.08); border-color: var(--danger); color: #ff8f86; }
.alert-success { background: rgba(111,207,151,.08); border-color: var(--success); color: var(--success); }

/* ---------- Badges / Tags ---------- */
.badge {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: .72rem; font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: .03em;
  text-transform: uppercase;
}
.badge-gold { background: rgba(212,175,93,.15); color: var(--gold-bright); border: 1px solid var(--gold-dim); }
.badge-teal { background: rgba(79,214,196,.12); color: var(--teal); border: 1px solid var(--teal-dim); }
.badge-danger { background: rgba(226,87,76,.12); color: #ff8f86; border: 1px solid var(--danger); }

/* ---------- Modal ---------- */
.modal-overlay {
  position: fixed; inset: 0;
  background: rgba(10, 7, 18, .72);
  backdrop-filter: blur(3px);
  display: none;
  align-items: center; justify-content: center;
  z-index: 200;
  padding: 20px;
}
.modal-overlay.open { display: flex; }
.modal {
  width: 100%; max-width: 440px;
  background: linear-gradient(180deg, var(--surface), var(--bg-alt));
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-glow-gold);
  padding: 30px 28px 26px;
  position: relative;
  max-height: 90vh;
  overflow-y: auto;
}
.modal-close {
  position: absolute; top: 16px; right: 16px;
  width: 30px; height: 30px;
  border-radius: 50%; border: 1px solid var(--border);
  background: transparent; color: var(--text-dim); cursor: pointer;
  display: grid; place-items: center;
}
.modal-close:hover { color: var(--text); border-color: var(--teal); }
.modal-tabs { display: flex; gap: 6px; margin-bottom: 22px; border: 1px solid var(--border); border-radius: var(--radius-sm); padding: 4px; }
.modal-tab {
  flex: 1; text-align: center; padding: 8px 10px; border-radius: 5px;
  font-size: .82rem; font-weight: 700; color: var(--text-dim); cursor: pointer; background: none; border: none;
}
.modal-tab.active { background: var(--surface-alt); color: var(--gold-bright); }
.modal-panel { display: none; }
.modal-panel.active { display: block; }

/* Botão do Discord */
.btn-discord {
  background: #5865F2; color: #fff; border-color: #5865F2;
}
.btn-discord:hover { background: #4752c4; color: #fff; box-shadow: 0 6px 20px rgba(88,101,242,.4); }

/* ---------- Utilidades de layout ---------- */
.section { padding: 80px 0; }
.section-tight { padding: 48px 0; }
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.text-center { text-align: center; }
.flex { display: flex; }
.flex-between { display: flex; align-items: center; justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; }

@media (max-width: 860px) {
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .section { padding: 56px 0; }
}

/* Skip link */
.skip-link {
  position: absolute; left: -999px; top: 0;
  background: var(--gold); color: #201607; padding: 10px 16px; z-index: 999;
  border-radius: 0 0 6px 0; font-weight: 700;
}
.skip-link:focus { left: 0; }
