/* ==========================================================
   MicroCosm Pro — Tema visual
   Design: dark mystical with gold accents
   ========================================================== */

:root {
  /* Colors */
  --bg: #0d0a14;
  --bg-elevated: #15111d;
  --bg-panel: rgba(28, 22, 38, 0.65);
  --bg-panel-strong: rgba(28, 22, 38, 0.92);
  --bg-panel-hover: rgba(38, 30, 52, 0.75);
  --border: rgba(212, 175, 55, 0.18);
  --border-strong: rgba(212, 175, 55, 0.4);
  --gold: #d4af37;
  --gold-soft: #c9a961;
  --gold-bright: #f0c94a;
  --text: #e8e3d8;
  --text-dim: #a89e8c;
  --text-muted: #6b6358;
  --accent: #b8860b;
  --danger: #c0392b;
  --success: #27ae60;
  --warning: #f39c12;
  --info: #3498db;

  /* Type */
  --font-serif: 'Cormorant Garamond', 'Garamond', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Layout */
  --max-width: 1100px;
  --radius: 4px;
  --radius-lg: 8px;
  --radius-xl: 12px;

  /* Motion */
  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

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

html, body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-weight: 300;
  line-height: 1.65;
  min-height: 100vh;
  overflow-x: hidden;
}

body {
  background:
    radial-gradient(ellipse at 20% 0%, rgba(212, 175, 55, 0.06) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 100%, rgba(184, 134, 11, 0.04) 0%, transparent 50%),
    var(--bg);
  position: relative;
}

a { color: var(--gold-soft); text-decoration: none; transition: color 0.2s var(--ease); }
a:hover { color: var(--gold-bright); }

/* ============ DECORATIVE BG ============ */
.bg-stars {
  position: fixed; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    radial-gradient(1px 1px at 25% 30%, rgba(212, 175, 55, 0.4), transparent),
    radial-gradient(1px 1px at 60% 80%, rgba(212, 175, 55, 0.3), transparent),
    radial-gradient(1px 1px at 85% 20%, rgba(212, 175, 55, 0.4), transparent),
    radial-gradient(1px 1px at 15% 70%, rgba(212, 175, 55, 0.3), transparent);
  opacity: 0.5;
}
.bg-glow {
  position: fixed; top: -300px; right: -200px;
  width: 600px; height: 600px;
  background: radial-gradient(circle, rgba(212, 175, 55, 0.04) 0%, transparent 70%);
  border-radius: 50%; pointer-events: none; z-index: 0;
}

/* ============ TOP NAV ============ */
.topnav {
  position: sticky; top: 0; z-index: 50;
  background: rgba(13, 10, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.topnav-inner {
  max-width: var(--max-width); margin: 0 auto;
  padding: 0.9rem 1.5rem;
  display: flex; align-items: center; gap: 2rem;
}
.topnav-brand {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-serif); font-size: 1.25rem;
  color: var(--gold); font-style: italic; font-weight: 400;
}
.topnav-brand:hover { color: var(--gold-bright); }
.brand-glyph { color: var(--gold); font-size: 1.1rem; }

.topnav-links {
  list-style: none; display: flex; gap: 1.2rem;
  margin: 0 auto 0 1rem;
}
.topnav-links a {
  font-size: 0.85rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--text-dim);
  font-weight: 500; padding: 0.4rem 0.2rem;
  border-bottom: 1px solid transparent;
}
.topnav-links a:hover { color: var(--gold); border-bottom-color: var(--gold); }

.topnav-user {
  display: flex; align-items: center; gap: 1rem;
  font-size: 0.9rem; color: var(--text-dim);
}
.user-name { font-family: var(--font-serif); font-style: italic; color: var(--gold-soft); font-size: 1.05rem; }
.user-logout {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border: 1px solid var(--border); border-radius: 50%;
  color: var(--text-dim); transition: all 0.2s var(--ease);
}
.user-logout:hover { border-color: var(--gold); color: var(--gold); }

/* ============ PAGE / CONTAINER ============ */
.page {
  position: relative; z-index: 1;
  min-height: calc(100vh - 60px);
  padding: 2.5rem 1.5rem;
}
.page-fullscreen {
  display: flex; align-items: center; justify-content: center;
  min-height: 100vh; padding: 2rem 1rem;
}
.container {
  max-width: var(--max-width); margin: 0 auto;
}

/* ============ DASHBOARD ============ */
.dashboard-hero {
  text-align: center; margin-bottom: 3rem;
  animation: fadeUp 0.8s var(--ease);
}
.dashboard-hero h1 {
  font-family: var(--font-serif); font-weight: 300;
  font-size: clamp(2rem, 5vw, 3rem); font-style: italic;
  color: var(--gold); letter-spacing: -0.01em;
  margin-bottom: 0.5rem;
}
.muted { color: var(--text-dim); }

.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem; margin-bottom: 3rem;
  animation: fadeUp 0.8s var(--ease) 0.1s backwards;
}
.tile {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.8rem 1.5rem;
  display: flex; flex-direction: column; gap: 0.5rem;
  transition: all 0.3s var(--ease); position: relative; overflow: hidden;
  color: inherit;
}
.tile:hover {
  border-color: var(--border-strong); transform: translateY(-2px);
  background: var(--bg-panel-hover);
}
.tile-icon {
  font-family: var(--font-serif); font-size: 2rem;
  color: var(--gold); margin-bottom: 0.5rem; line-height: 1;
}
.tile h3 {
  font-family: var(--font-serif); font-weight: 500;
  font-size: 1.4rem; color: var(--text);
}
.tile p {
  color: var(--text-dim); font-size: 0.92rem;
  flex-grow: 1; line-height: 1.55;
}
.tile-soon {
  font-size: 0.7rem; text-transform: uppercase;
  letter-spacing: 0.15em; color: var(--gold);
  opacity: 0.7; margin-top: 0.6rem;
}
.tile-admin { border-color: rgba(212, 175, 55, 0.35); }
.tile-active {
    border-color: var(--color-gold, #c9a84c);
    opacity: 1;
}
/* ── Tile com estatística (Perfis activos) ─────────────────────── */
.tile-stat {
  display: inline-block;
  margin-top: 0.6rem;
  padding: 0.25rem 0.7rem;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid rgba(212, 175, 55, 0.35);
  border-radius: 999px;
  color: #d4af37;
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.02em;
}

.tile-hint {
  display: block;
  margin-top: 0.6rem;
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.5);
  font-style: italic;
}

/* ── Dot "próxima fase" (dourado, em vez de cinza) ─────────────── */
.dot-next {
  background: #d4af37;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.18);
}

/* ============ STATUS LIST ============ */
.dashboard-status {
  background: var(--bg-panel); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 1.8rem;
  animation: fadeUp 0.8s var(--ease) 0.2s backwards;
}
.section-title {
  font-family: var(--font-serif); font-style: italic;
  font-weight: 400; font-size: 1.3rem; color: var(--gold);
  margin-bottom: 1rem;
}
.status-list { list-style: none; }
.status-list li {
  display: flex; align-items: center; gap: 0.7rem;
  padding: 0.5rem 0; color: var(--text-dim); font-size: 0.95rem;
  border-bottom: 1px solid var(--border);
}
.status-list li:last-child { border-bottom: none; }
.status-list strong { color: var(--text); font-weight: 500; }
.dot {
  width: 8px; height: 8px; border-radius: 50%;
  display: inline-block; flex-shrink: 0;
}
.dot-ok { background: var(--success); box-shadow: 0 0 8px var(--success); }
.dot-pending { background: var(--text-muted); }

/* ============ LOGIN ============ */
.page-login { background: var(--bg); }
.login-shell {
  width: 100%; max-width: 440px; padding: 2rem 1rem;
  position: relative; z-index: 1;
}
.login-card {
  background: var(--bg-panel-strong);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 3rem 2.5rem;
  backdrop-filter: blur(20px);
  text-align: center;
  position: relative;
  animation: fadeUp 0.6s var(--ease);
}
.login-card::before {
  content: ''; position: absolute; top: 0; left: 0; right: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
  opacity: 0.5;
}
.login-glyph {
  width: 90px; height: 90px; margin: 0 auto 1.5rem;
  animation: rotateSlow 60s linear infinite;
}
.login-title {
  font-family: var(--font-serif);
  font-weight: 300; font-style: italic;
  font-size: 2.2rem; color: var(--gold);
  margin-bottom: 0.4rem; letter-spacing: -0.01em;
}
.login-subtitle {
  color: var(--text-dim); font-size: 0.95rem;
  margin-bottom: 2rem;
}
.login-form {
  display: flex; flex-direction: column; gap: 1.2rem;
  text-align: left;
}

/* ============ FIELDS ============ */
.field { display: block; }
.field-label {
  display: block;
  font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.18em; color: var(--text-dim);
  margin-bottom: 0.45rem; font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: rgba(13, 10, 20, 0.6);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-serif); font-size: 1.1rem;
  padding: 0.75rem 1rem; border-radius: var(--radius);
  transition: all 0.2s var(--ease);
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none; border-color: var(--gold);
  background: rgba(13, 10, 20, 0.9);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.1);
}

/* ============ BUTTONS ============ */
.btn-primary, .btn-secondary {
  font-family: var(--font-sans);
  font-size: 0.85rem; letter-spacing: 0.15em;
  text-transform: uppercase; font-weight: 500;
  padding: 0.85rem 1.6rem;
  border-radius: var(--radius); cursor: pointer;
  transition: all 0.3s var(--ease);
  display: inline-flex; align-items: center; justify-content: center; gap: 0.6rem;
  border: 1px solid;
}
.btn-primary {
  background: linear-gradient(180deg, var(--gold), var(--accent));
  color: var(--bg); border-color: var(--gold);
  box-shadow: 0 4px 18px rgba(212, 175, 55, 0.18);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 24px rgba(212, 175, 55, 0.3);
  background: linear-gradient(180deg, var(--gold-bright), var(--gold));
  color: var(--bg);
}
.btn-secondary {
  background: transparent; color: var(--text-dim); border-color: var(--border);
}
.btn-secondary:hover { border-color: var(--gold); color: var(--gold); }

/* ============ FLASH MESSAGES ============ */
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.92rem;
  border-left: 3px solid;
  background: rgba(255, 255, 255, 0.04);
}
.flash-success { border-color: var(--success); color: #6fd99c; }
.flash-error   { border-color: var(--danger);  color: #e89890; }
.flash-warning { border-color: var(--warning); color: #f3c674; }
.flash-info    { border-color: var(--info);    color: #88c5e6; }

/* ============ PLACEHOLDER ============ */
.placeholder-card {
  text-align: center;
  background: var(--bg-panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 4rem 2rem;
  max-width: 500px; margin: 3rem auto;
  animation: fadeUp 0.6s var(--ease);
}
.placeholder-glyph {
  font-family: var(--font-serif);
  font-size: 4rem; color: var(--gold);
  margin-bottom: 1rem;
}
.placeholder-card h1 {
  font-family: var(--font-serif);
  font-weight: 300; font-style: italic;
  color: var(--gold); margin-bottom: 1rem;
}
.placeholder-card p { margin-bottom: 1rem; color: var(--text-dim); }
.placeholder-card .btn-primary { margin-top: 1rem; }

/* ============ FOOTER ============ */
.appfoot {
  margin-top: 4rem; padding: 1.5rem;
  text-align: center;
  border-top: 1px solid var(--border);
  position: relative; z-index: 1;
}
.appfoot small { color: var(--text-muted); font-size: 0.8rem; }

/* ============ ANIMATIONS ============ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes rotateSlow {
  from { transform: rotate(0deg); }
  to   { transform: rotate(360deg); }
}

/* ============ SCROLLBAR ============ */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: var(--border-strong); }

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .topnav-inner { gap: 1rem; flex-wrap: wrap; padding: 0.7rem 1rem; }
  .topnav-links { gap: 0.7rem; margin: 0; order: 3; width: 100%; justify-content: space-between; }
  .topnav-links a { font-size: 0.75rem; }
  .login-card { padding: 2rem 1.5rem; }
  .page { padding: 1.5rem 1rem; }
}
