/* Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700;800&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@500;700&display=swap');

/* ═══════════════════════════════════════════════════════════════ */
/* CSS Custom Properties — PRD Color Palette                      */
/* ═══════════════════════════════════════════════════════════════ */
:root {
  /* Fundos */
  --bg-base: oklch(0.15 0.015 250);
  --bg-surface: oklch(0.20 0.015 250);
  --bg-elevated: oklch(0.25 0.015 250);

  /* Primária — Ouro */
  --primary: oklch(0.75 0.14 75);
  --primary-hover: oklch(0.67 0.14 75);
  --primary-foreground: oklch(0.15 0.015 250);

  /* Secundária — Azul Céu */
  --secondary: oklch(0.60 0.16 240);
  --secondary-hover: oklch(0.52 0.16 240);

  /* Acento — Verde Jacaré */
  --accent: oklch(0.58 0.16 155);
  --accent-hover: oklch(0.50 0.16 155);

  /* Feedback */
  --success: oklch(0.65 0.18 155);
  --danger: oklch(0.60 0.22 25);
  --warning: oklch(0.75 0.15 65);

  /* Texto */
  --text-primary: oklch(0.93 0 0);
  --text-secondary: oklch(0.68 0 0);
  --text-muted: oklch(0.45 0 0);

  /* Bordas */
  --border: oklch(0.30 0.015 250);
  --border-highlight: oklch(0.75 0.14 75 / 0.3);

  /* Config */
  --radius: 0.75rem;
  --radius-lg: 1rem;
  --shadow: 0 4px 24px oklch(0 0 0 / 0.5);
  --shadow-glow: 0 0 20px oklch(0.75 0.14 75 / 0.15);

  /* Fontes */
  --font-heading: 'Outfit', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* Base styles */
*, *::before, *::after { box-sizing: border-box; }

html { font-size: 16px; }

body {
  font-family: var(--font-body);
  background-color: var(--bg-base);
  color: var(--text-primary);
  min-height: 100vh;
  margin: 0;
  -webkit-font-smoothing: antialiased;
}

/* Headings */
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); }
h1 { font-weight: 800; font-size: 1.875rem; }
h2 { font-weight: 700; font-size: 1.5rem; }
h3 { font-weight: 600; font-size: 1.25rem; }

/* Links */
a { color: var(--secondary); text-decoration: none; transition: color 150ms ease; }
a:hover { color: var(--secondary-hover); }

/* Money values */
.money { font-family: var(--font-mono); font-weight: 700; }
.money-positive { color: var(--success); }
.money-negative { color: var(--danger); }

/* App container */
.app-container {
  max-width: 480px;
  margin: 0 auto;
  padding: 0 1rem;
  min-height: 100vh;
}

/* Header */
.app-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
}
.app-header img { height: 36px; }
.app-header .user-info {
  font-size: 0.875rem;
  color: var(--text-secondary);
  text-align: right;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius);
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 1rem;
  border: none;
  cursor: pointer;
  transition: all 150ms ease;
  min-height: 44px;
  min-width: 44px;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--primary);
  color: var(--primary-foreground);
}
.btn-primary:hover {
  background: var(--primary-hover);
  box-shadow: var(--shadow-glow);
  transform: scale(1.02);
}

.btn-secondary {
  background: transparent;
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.btn-secondary:hover { background: var(--bg-elevated); }

.btn-danger {
  background: var(--danger);
  color: white;
}
.btn-danger:hover { opacity: 0.85; }

.btn-block { width: 100%; }

/* Cards */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1rem 1.25rem;
  transition: all 200ms ease-out;
}
.card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
}
.card + .card { margin-top: 0.75rem; }

/* Badges */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.25rem 0.75rem;
  border-radius: 9999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-waiting { background: oklch(0.75 0.15 65 / 0.15); color: var(--warning); }
.badge-success { background: oklch(0.65 0.18 155 / 0.15); color: var(--success); }
.badge-danger { background: oklch(0.60 0.22 25 / 0.15); color: var(--danger); }
.badge-pending { background: oklch(0.60 0.16 240 / 0.15); color: var(--secondary); }

/* Forms */
.form-group { margin-bottom: 1rem; }
.form-label {
  display: block;
  margin-bottom: 0.5rem;
  font-size: 0.875rem;
  color: var(--text-secondary);
}
.form-input {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color 150ms ease;
}
.form-input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px oklch(0.75 0.14 75 / 0.2);
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 1.5rem;
}
.pagination a, .pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  text-decoration: none;
  transition: all 150ms ease;
}
.pagination a {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  color: var(--text-primary);
}
.pagination a:hover { background: var(--bg-elevated); }
.pagination .active {
  background: var(--primary);
  color: var(--primary-foreground);
  border: none;
}

/* Navigation */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  transition: color 150ms ease;
}
.back-link:hover { color: var(--text-primary); }

/* Dashboard grid */
.dashboard-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.dashboard-card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  text-align: center;
  text-decoration: none;
  color: var(--text-primary);
  transition: all 200ms ease-out;
}
.dashboard-card:hover {
  border-color: var(--border-highlight);
  box-shadow: var(--shadow-glow);
  transform: translateY(-2px);
  color: var(--text-primary);
}
.dashboard-card .icon { font-size: 2rem; margin-bottom: 0.5rem; }
.dashboard-card .label { font-weight: 600; }
.dashboard-card-full { grid-column: 1 / -1; }

/* Alerts/Messages */
.alert {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
  font-size: 0.875rem;
}
.alert-error { background: oklch(0.60 0.22 25 / 0.15); color: var(--danger); border: 1px solid oklch(0.60 0.22 25 / 0.3); }
.alert-success { background: oklch(0.65 0.18 155 / 0.15); color: var(--success); border: 1px solid oklch(0.65 0.18 155 / 0.3); }
.alert-info { background: oklch(0.60 0.16 240 / 0.15); color: var(--secondary); border: 1px solid oklch(0.60 0.16 240 / 0.3); }

/* Balance display */
.balance-display {
  text-align: center;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}
.balance-label { font-size: 0.875rem; color: var(--text-secondary); margin-bottom: 0.25rem; }
.balance-value { font-family: var(--font-mono); font-weight: 700; font-size: 2rem; color: var(--primary); }

/* Section title */
.section-title {
  font-family: var(--font-heading);
  font-weight: 700;
  font-size: 1rem;
  color: var(--text-secondary);
  padding-bottom: 0.75rem;
  margin-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

/* Empty state */
.empty-state {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Animations */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}
.animate-in { animation: fadeInUp 400ms ease-out; }
.card { animation: fadeInUp 300ms ease-out; }

/* Confirmation modal overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: oklch(0 0 0 / 0.7);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.modal-content {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.5rem;
  max-width: 400px;
  width: 90%;
}
.modal-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
}
.modal-actions .btn { flex: 1; }

/* Progress bar */
.progress-bar {
  height: 10px;
  background: var(--bg-elevated);
  border-radius: 9999px;
  overflow: hidden;
  margin-top: 0.5rem;
}
.progress-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--secondary), var(--primary));
  border-radius: 9999px;
  transition: width 600ms ease-out;
  min-width: 4px;
}

/* Raffle panel (reveal on click) */
.raffle-panel {
  display: none;
  animation: fadeInUp 300ms ease-out;
}
.raffle-panel.open { display: block; }

/* Utility */
.text-muted { color: var(--text-muted); }
.text-secondary { color: var(--text-secondary); }
.text-small { font-size: 0.875rem; }
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.flex-between { display: flex; justify-content: space-between; align-items: center; }
.gap-sm { gap: 0.5rem; }
