:root {
  --brand-primary: #003399;
  --brand-primary-dark: #002266;
  --brand-primary-light: #1a4db3;
  --brand-accent: #4d7fd9;
  --surface: #ffffff;
  --surface-muted: #f4f7fc;
  --text-primary: #0f172a;
  --text-secondary: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 50px rgba(0, 51, 153, 0.12);
  --radius-lg: 20px;
  --radius-xl: 28px;
}

html {
  font-size: 15px;
  position: relative;
  min-height: 100%;
  scroll-behavior: smooth;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  background: var(--surface-muted);
  color: var(--text-primary);
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  margin-bottom: 0;
  -webkit-font-smoothing: antialiased;
}

/* Navbar */
.site-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
  position: sticky;
  top: 0;
  z-index: 100;
}

.site-navbar {
  align-items: center;
  display: flex;
  gap: 1rem;
  min-height: 72px;
  padding: 0.75rem 0;
}

.site-navbar .navbar-brand {
  align-items: center;
  color: var(--text-primary);
  display: flex;
  font-size: 1rem;
  font-weight: 700;
  gap: 0.75rem;
  letter-spacing: -0.02em;
  text-decoration: none;
}

.site-navbar .navbar-brand:hover {
  color: var(--brand-primary);
}

.site-navbar .brand-logo {
  height: 44px;
  object-fit: contain;
  width: 44px;
}

.site-navbar .brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.site-navbar .brand-subtitle {
  color: var(--text-secondary);
  font-size: 0.75rem;
  font-weight: 500;
}

.site-nav-link {
  color: var(--text-secondary);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  transition: color 0.15s ease;
}

.site-nav-link:hover {
  color: var(--brand-primary);
}

/* Main */
.page-shell {
  max-width: 1120px;
  padding-bottom: 4rem;
  padding-top: 2rem;
}

/* Hero */
.championship-hero {
  background: linear-gradient(145deg, var(--brand-primary) 0%, var(--brand-primary-dark) 55%, #001a4d 100%);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-lg);
  color: #fff;
  overflow: visible;
  padding: 3rem 2.5rem;
  position: relative;
}

.championship-hero::before {
  background: radial-gradient(circle at 85% 15%, rgba(255, 255, 255, 0.12) 0%, transparent 50%);
  border-radius: inherit;
  content: "";
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  position: absolute;
}

.championship-hero > .row {
  position: relative;
  z-index: 1;
}

.hero-eyebrow {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 999px;
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  padding: 0.4rem 0.9rem;
  text-transform: uppercase;
}

.hero-title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.15;
  margin-top: 1rem;
}

.hero-lead {
  color: rgba(255, 255, 255, 0.85);
  font-size: 1.05rem;
  line-height: 1.6;
  margin-top: 1rem;
  max-width: 32rem;
}

.hero-club {
  align-items: center;
  display: flex;
  gap: 1.25rem;
  margin-bottom: 0.5rem;
}

.club-logo {
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
  flex-shrink: 0;
  height: 88px;
  object-fit: contain;
  padding: 0.5rem;
  width: 88px;
}

.hero-meta {
  color: rgba(255, 255, 255, 0.7);
  font-size: 0.875rem;
  margin-top: 1.5rem;
}

/* Poll card */
.poll-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  overflow: visible;
  padding: 2rem;
  position: relative;
  z-index: 2;
}

.poll-card-header {
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.75rem;
  padding-bottom: 1.25rem;
}

.poll-card-header h2 {
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0;
}

.poll-card-header p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.35rem 0 0;
}

.form-label {
  color: var(--text-primary);
  font-size: 0.875rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.form-control,
.form-select {
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.95rem;
  padding: 0.75rem 1rem;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.form-control:focus,
.form-select:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

.btn-vote {
  background: var(--brand-primary);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-size: 1rem;
  font-weight: 600;
  padding: 0.9rem 1.5rem;
  transition: background 0.15s ease, transform 0.1s ease;
  width: 100%;
}

.btn-vote:hover {
  background: var(--brand-primary-dark);
  color: #fff;
  transform: translateY(-1px);
}

.btn-vote:active {
  transform: translateY(0);
}

.alert-success-custom {
  align-items: flex-start;
  background: #ecfdf5;
  border: 1px solid #a7f3d0;
  border-radius: 12px;
  color: #065f46;
  display: flex;
  gap: 0.75rem;
  margin-bottom: 1.5rem;
  padding: 1rem 1.15rem;
}

.alert-success-custom .alert-icon {
  background: #10b981;
  border-radius: 50%;
  color: #fff;
  flex-shrink: 0;
  font-size: 0.85rem;
  font-weight: 700;
  height: 28px;
  line-height: 28px;
  text-align: center;
  width: 28px;
}

/* Steps */
.steps-section {
  margin-top: 3rem;
}

.section-title {
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 1.25rem;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.step-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  height: 100%;
  padding: 1.5rem;
  transition: box-shadow 0.2s ease;
}

.step-card:hover {
  box-shadow: var(--shadow-md);
}

.step-number {
  align-items: center;
  background: linear-gradient(135deg, var(--brand-primary), var(--brand-primary-light));
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  font-size: 0.8rem;
  font-weight: 700;
  height: 36px;
  justify-content: center;
  margin-bottom: 1rem;
  width: 36px;
}

.step-card strong {
  display: block;
  font-size: 1rem;
  margin-bottom: 0.35rem;
}

.step-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

/* Results */
.results-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-top: 3rem;
  padding: 2.5rem;
}

.results-header {
  align-items: flex-start;
  border-bottom: 1px solid var(--border);
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 2rem;
  padding-bottom: 1.5rem;
}

.results-header h2 {
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0.5rem 0 0;
}

.results-header .subtitle {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0.25rem 0 0;
}

.total-votes-pill {
  align-items: center;
  background: var(--brand-primary);
  border-radius: 12px;
  color: #fff;
  display: inline-flex;
  flex-direction: column;
  font-weight: 600;
  min-width: 120px;
  padding: 0.75rem 1.25rem;
  text-align: center;
}

.total-votes-pill .count {
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1;
}

.total-votes-pill .label {
  font-size: 0.75rem;
  font-weight: 500;
  margin-top: 0.2rem;
  opacity: 0.9;
}

.empty-results {
  color: var(--text-secondary);
  padding: 2rem 0;
  text-align: center;
}

.empty-results-icon {
  color: var(--border);
  font-size: 2.5rem;
  margin-bottom: 0.75rem;
}

.vote-result {
  padding: 1rem 0;
}

.vote-result + .vote-result {
  border-top: 1px solid var(--border);
}

.vote-result.is-leader .vote-result-name {
  color: var(--brand-primary);
}

.vote-result-row {
  align-items: center;
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.vote-result-name {
  align-items: center;
  display: flex;
  font-size: 1rem;
  font-weight: 600;
  gap: 0.5rem;
}

.leader-badge {
  background: #fef3c7;
  border-radius: 6px;
  color: #92400e;
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  text-transform: uppercase;
}

.vote-result-stats {
  color: var(--text-secondary);
  font-size: 0.875rem;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.vote-result-stats strong {
  color: var(--text-primary);
}

.progress {
  background: #e8eef7;
  border-radius: 999px;
  height: 10px;
  overflow: hidden;
}

.progress-bar {
  background: linear-gradient(90deg, var(--brand-primary), var(--brand-accent));
  border-radius: 999px;
  transition: width 0.6s ease;
}

.vote-result.is-leader .progress-bar {
  background: linear-gradient(90deg, var(--brand-primary-dark), var(--brand-primary));
}

/* Footer */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 0.875rem;
  margin-top: 4rem;
  padding: 1.5rem 0;
}

.site-footer a {
  color: var(--brand-primary);
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

/* Combo de times na enquete */
.team-combo {
  position: relative;
}

.team-combo-trigger {
  align-items: center;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  padding: 0.65rem 1rem;
  text-align: left;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
  width: 100%;
}

.team-combo-trigger:hover {
  border-color: var(--brand-accent);
}

.team-combo-trigger:focus {
  border-color: var(--brand-accent);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
  outline: none;
}

.team-combo-trigger[aria-expanded="true"] {
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 3px rgba(0, 51, 153, 0.12);
}

.team-combo-value {
  align-items: center;
  display: flex;
  flex: 1;
  gap: 0.75rem;
  min-width: 0;
}

.team-combo-value.is-placeholder .team-combo-value-name {
  color: var(--text-secondary);
  font-weight: 500;
}

.team-combo-value-logo {
  border-radius: 8px;
  flex-shrink: 0;
  height: 36px;
  object-fit: contain;
  width: 36px;
}

.team-combo-value-name {
  color: var(--text-primary);
  font-size: 0.95rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.team-combo-chevron {
  border-bottom: 2px solid var(--text-secondary);
  border-right: 2px solid var(--text-secondary);
  flex-shrink: 0;
  height: 8px;
  margin-top: -2px;
  transform: rotate(45deg);
  transition: transform 0.15s ease;
  width: 8px;
}

.team-combo-trigger[aria-expanded="true"] .team-combo-chevron {
  margin-top: 2px;
  transform: rotate(-135deg);
}

.team-combo-list {
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.18);
  list-style: none;
  margin: 0;
  max-height: 320px;
  overflow-y: auto;
  padding: 0.35rem;
  position: fixed;
  width: auto;
  z-index: 1050;
}

.team-combo-list[hidden] {
  display: none;
}

.team-combo-option {
  align-items: center;
  border-radius: 10px;
  cursor: pointer;
  display: flex;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  transition: background 0.1s ease;
}

.team-combo-option:hover {
  background: var(--surface-muted);
}

.team-combo-option.selected {
  background: #e8f0ff;
}

.team-combo-option img {
  border-radius: 8px;
  flex-shrink: 0;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

.team-combo-option span {
  color: var(--text-primary);
  font-size: 0.9rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.teams-showcase-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
}

.teams-showcase-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding: 1.25rem 1rem;
  text-align: center;
}

.teams-showcase-item img {
  height: 64px;
  object-fit: contain;
  width: 64px;
}

.teams-showcase-item span {
  font-size: 0.9rem;
  font-weight: 600;
}

.vote-result-logo {
  border-radius: 8px;
  height: 32px;
  object-fit: contain;
  width: 32px;
}

@media (max-width: 767.98px) {
  .page-shell {
    padding-top: 1rem;
  }

  .championship-hero {
    border-radius: var(--radius-lg);
    padding: 2rem 1.25rem;
  }

  .hero-club {
    flex-direction: column;
    text-align: center;
  }

  .club-logo {
    height: 72px;
    width: 72px;
  }

  .poll-card,
  .results-section {
    padding: 1.5rem;
  }

  .vote-result-row {
    align-items: flex-start;
    flex-direction: column;
    gap: 0.35rem;
  }
}
