html {
  font-size: 14px;
  position: relative;
  min-height: 100%;
}

@media (min-width: 768px) {
  html {
    font-size: 16px;
  }
}

body {
  margin-bottom: 60px;
  background-color: #f8f9fa;
}

.btn:focus, .btn:active:focus, .btn-link.nav-link:focus, .form-control:focus, .form-check-input:focus {
  box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Modern card styling */
.card {
  border: none;
  box-shadow: 0 0.125rem 0.25rem rgba(0, 0, 0, 0.075);
  transition: box-shadow 0.15s ease-in-out;
}

.card:hover {
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.15);
}

.card-header {
  background-color: #fff;
  border-bottom: 2px solid #e9ecef;
  font-weight: 600;
}

/* Table styling */
.table {
  background-color: #fff;
}

.table thead th {
  background-color: #f8f9fa;
  border-bottom: 2px solid #dee2e6;
  font-weight: 600;
  text-transform: uppercase;
  font-size: 0.875rem;
  letter-spacing: 0.5px;
}

.table tbody tr {
  transition: background-color 0.15s ease-in-out;
}

.table tbody tr:hover {
  background-color: #f8f9fa;
}

/* Form styling */
.form-label {
  font-weight: 600;
  color: #495057;
  margin-bottom: 0.5rem;
}

.form-control {
  border: 1px solid #ced4da;
  transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
  border-color: #80bdff;
  box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
}

/* Button groups */
.btn-group-actions .btn {
  margin-right: 0.25rem;
}

.btn-group-actions .btn:last-child {
  margin-right: 0;
}

/* Page headers */
.page-header {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  padding: 2rem 0;
  margin-bottom: 2rem;
  border-radius: 0.5rem;
}

.page-header h1 {
  margin: 0;
  font-weight: 700;
}

/* Badge styling */
.badge {
  padding: 0.5em 0.75em;
  font-weight: 500;
}

/* Action links styling */
.action-link {
  text-decoration: none;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: all 0.15s ease-in-out;
}

.action-link:hover {
  text-decoration: none;
}

/* UI-01: Dropdown arrow indicators */
.form-select {
  background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3e%3cpath fill='none' stroke='%23343a40' stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M2 5l6 6 6-6'/%3e%3c/svg%3e");
  background-repeat: no-repeat;
  background-position: right 0.75rem center;
  background-size: 16px 12px;
  padding-right: 2.5rem;
}

/* UI-01: Standardized button styles */
.btn {
  font-weight: 500;
  border-radius: 0.375rem;
  transition: all 0.15s ease-in-out;
}

.btn-primary {
  background-color: #0d6efd;
  border-color: #0d6efd;
}

.btn-primary:hover {
  background-color: #0b5ed7;
  border-color: #0a58ca;
}

.btn-secondary {
  background-color: #6c757d;
  border-color: #6c757d;
}

.btn-secondary:hover {
  background-color: #5c636a;
  border-color: #565e64;
}

/* UI-01: Standardized error messages */
.text-danger {
  color: #dc3545 !important;
  font-size: 0.875rem;
}

.validation-summary-errors {
  background-color: #f8d7da;
  border: 1px solid #f5c2c7;
  border-radius: 0.375rem;
  padding: 0.75rem;
  margin-bottom: 1rem;
}

.validation-summary-errors ul {
  margin-bottom: 0;
  padding-left: 1.5rem;
}

/* ========== Index page – design tokens & layout ========== */
.index-page {
  --index-surface: #ffffff;
  --index-surface-hover: #f8fafc;
  --index-border: rgba(0, 0, 0, 0.06);
  --index-accent: #0d6efd;
  --index-accent-soft: rgba(13, 110, 253, 0.12);
  --index-text: #1e293b;
  --index-text-muted: #64748b;
  --index-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
  --index-shadow-hover: 0 4px 12px rgba(0, 0, 0, 0.08);
  --index-radius: 12px;
  --index-radius-sm: 8px;
  --index-transition: 0.2s ease;
}

.index-page .index-hero {
  padding: 2rem 0 3rem;
}

.index-page .index-grid {
  display: grid;
  gap: 1.5rem;
  grid-template-columns: 1fr;
  grid-template-areas:
    "full"
    "main"
    "sidebar";
}

.index-page .index-col-full { grid-area: full; }
.index-page .index-col-main { grid-area: main; }
.index-page .index-col-sidebar { grid-area: sidebar; }

@media (min-width: 992px) {
  .index-page .index-grid {
    grid-template-columns: 1fr 360px;
    grid-template-areas:
      "full full"
      "main sidebar";
  }
}

/* ========== Index cards ========== */
.index-card {
  background: var(--index-surface);
  border-radius: var(--index-radius);
  box-shadow: var(--index-shadow);
  border: 1px solid var(--index-border);
  overflow: hidden;
  transition: box-shadow var(--index-transition), border-color var(--index-transition);
  position: relative;
}

.index-card:hover {
  box-shadow: var(--index-shadow-hover);
}

.index-card-accent {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--index-accent);
  border-radius: var(--index-radius) 0 0 var(--index-radius);
}

.index-card-inner {
  margin-left: 4px;
}

.index-card-header {
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--index-border);
  background: var(--index-surface);
}

.index-card-title {
  margin: 0;
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--index-text);
  letter-spacing: -0.01em;
}

.index-card-body {
  padding: 1.25rem;
}

.index-card-footer {
  padding: 0.75rem 1.25rem;
  border-top: 1px solid var(--index-border);
  background: var(--index-surface-hover);
}

/* ========== Event in progress (featured) ========== */
.index-card-featured .index-card-body {
  padding: 1.25rem;
}

/* Carrossel eventos em andamento (vários eventos) */
.events-in-progress-card .index-card-body.p-0 {
  padding: 0 !important;
}

.events-in-progress-track {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.events-in-progress-track::-webkit-scrollbar {
  display: none;
}

.events-in-progress-slide {
  flex: 0 0 100%;
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-width: 0;
}

.events-in-progress-slide > .event-in-progress {
  padding: 1.25rem;
}

.events-in-progress-nav {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
}

.index-carousel-btn {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--index-border);
  background: var(--index-surface);
  color: var(--index-text);
  border-radius: var(--index-radius-sm);
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  transition: background-color var(--index-transition), border-color var(--index-transition);
}

.index-carousel-btn:hover {
  background: var(--index-surface-hover);
  border-color: var(--index-accent);
  color: var(--index-accent);
}

.events-in-progress-counter {
  font-size: 0.875rem;
  color: var(--index-text-muted);
  min-width: 3rem;
  text-align: center;
}

.index-card-empty {
  font-size: 0.9375rem;
}

.event-in-progress {
  display: grid;
  gap: 1.25rem;
  align-items: center;
  grid-template-columns: 1fr;
}

@media (min-width: 768px) {
  .event-in-progress {
    grid-template-columns: 180px 1fr auto;
  }
}

.event-in-progress-media {
  border-radius: var(--index-radius-sm);
  overflow: hidden;
  background: var(--index-surface-hover);
}

.event-in-progress-img {
  width: 100%;
  height: 120px;
  object-fit: cover;
  display: block;
}

@media (min-width: 768px) {
  .event-in-progress-img {
    height: 100%;
    min-height: 100px;
  }
}

.event-in-progress-content {
  min-width: 0;
}

.event-in-progress-title {
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--index-text);
  margin: 0 0 0.5rem 0;
  line-height: 1.3;
}

.index-badge {
  display: inline-block;
  padding: 0.25rem 0.6rem;
  font-size: 0.75rem;
  font-weight: 600;
  border-radius: 999px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.index-badge-live {
  background: var(--index-accent-soft);
  color: var(--index-accent);
}

.event-in-progress-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
}

.event-meta-item {
  display: flex;
  align-items: baseline;
  gap: 0.35rem;
}

.event-meta-item dt {
  margin: 0;
  font-weight: 500;
  color: var(--index-text-muted);
}

.event-meta-item dd {
  margin: 0;
  color: var(--index-text);
}

.event-in-progress-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
}

@media (max-width: 767px) {
  .event-in-progress-actions {
    justify-content: stretch;
  }
}

/* ========== Index buttons ========== */
.index-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.5rem 1rem;
  font-size: 0.875rem;
  font-weight: 500;
  border-radius: var(--index-radius-sm);
  text-decoration: none;
  transition: background-color var(--index-transition), color var(--index-transition), box-shadow var(--index-transition);
  border: none;
  cursor: pointer;
}

.index-btn-primary {
  background: var(--index-accent);
  color: #fff;
  min-width: 160px;
}

.index-btn-primary:hover {
  background: #0b5ed7;
  color: #fff;
  box-shadow: 0 2px 8px rgba(13, 110, 253, 0.35);
}

.index-btn-ghost {
  background: transparent;
  color: var(--index-text-muted);
  width: 100%;
}

.index-btn-ghost:hover {
  background: var(--index-surface-hover);
  color: var(--index-accent);
}

/* ========== Index list (competitions & news) ========== */
.index-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.index-list-item {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  padding: 0.75rem 0;
  text-decoration: none;
  color: inherit;
  border-radius: var(--index-radius-sm);
  transition: background-color var(--index-transition);
}

.index-list-item:hover {
  background: var(--index-surface-hover);
}

.index-list-item:not(:last-child) {
  border-bottom: 1px solid var(--index-border);
}

.index-list-date,
.index-list-meta {
  flex-shrink: 0;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--index-accent);
  min-width: 3rem;
  text-align: left;
}

.index-list-meta {
  font-weight: 500;
  color: var(--index-text-muted);
}

.index-list-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}

.index-list-title {
  font-weight: 500;
  color: var(--index-text);
  font-size: 0.9375rem;
}

.index-list-subtitle {
  font-size: 0.8125rem;
  color: var(--index-text-muted);
}

/* ========== Próximas competições – champ-indi (céu/ praia) ========== */
.upcoming-events-list {
  list-style: none;
  margin: 0;
  padding: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
}

.upcoming-events-list li {
  margin: 0;
}

.upcoming-events-row {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 1.25rem;
  min-height: 96px;
  text-decoration: none;
  color: #fff;
  position: relative;
  overflow: hidden;
  background-size: cover;
  background-position: center 65%;
  background-repeat: no-repeat;
  background-color: #c45c26;
  transition: transform var(--index-transition), box-shadow var(--index-transition);
}

.upcoming-events-row:hover {
  transform: scale(1.01);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.25);
  color: #fff;
}

/* Overlay para legibilidade sobre céu dourado/laranja */
.upcoming-events-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(105deg, rgba(20, 15, 10, 0.82) 0%, rgba(40, 25, 10, 0.55) 45%, rgba(80, 50, 20, 0.25) 100%);
  pointer-events: none;
}

.upcoming-events-date {
  position: relative;
  z-index: 1;
  flex-shrink: 0;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.6), 0 0 1px rgba(0, 0, 0, 0.8);
  min-width: 2.75rem;
}

.upcoming-events-content {
  position: relative;
  z-index: 1;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.upcoming-events-title {
  font-weight: 600;
  font-size: 0.9375rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
  color: #fff;
  text-shadow: 0 1px 3px rgba(0, 0, 0, 0.55), 0 0 1px rgba(0, 0, 0, 0.7);
}

.upcoming-events-subtitle {
  font-size: 0.8125rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
}

.upcoming-events-list li + li .upcoming-events-row {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
}

/* ========== Index – mobile (≤767px) ========== */
@media (max-width: 767px) {
  .index-page {
    --index-radius: 10px;
    --index-radius-sm: 6px;
    overflow-x: hidden;
  }

  .index-page .index-hero {
    padding: 1rem 0 1.5rem;
    padding-left: env(safe-area-inset-left, 0);
    padding-right: env(safe-area-inset-right, 0);
  }

  .index-page .index-grid {
    gap: 1rem;
    padding: 0;
  }

  .index-card {
    border-radius: var(--index-radius);
  }

  .index-card-header {
    padding: 0.875rem 1rem;
  }

  .index-card-title {
    font-size: 1rem;
  }

  .index-card-body {
    padding: 1rem;
  }

  .index-card-footer {
    padding: 0.625rem 1rem;
  }

  /* Event in progress – carousel & slide */
  .events-in-progress-card .index-card-header {
    flex-wrap: wrap;
    gap: 0.5rem;
  }

  .events-in-progress-slide > .event-in-progress {
    padding: 1rem;
  }

  .index-carousel-btn {
    width: 2.75rem;
    height: 2.75rem;
    min-width: 2.75rem;
    min-height: 2.75rem;
    font-size: 1.35rem;
  }

  .events-in-progress-nav {
    gap: 0.375rem;
  }

  .events-in-progress-counter {
    font-size: 0.8125rem;
    min-width: 2.5rem;
  }

  .event-in-progress-media {
    max-height: 140px;
  }

  .event-in-progress-img {
    height: 120px;
    max-height: 140px;
  }

  .event-in-progress-title {
    font-size: 1rem;
  }

  .event-in-progress-meta {
    font-size: 0.8125rem;
    gap: 0.75rem;
    margin-top: 0.5rem;
  }

  .index-btn,
  .index-btn-primary,
  .index-btn-ghost {
    min-height: 44px;
    padding: 0.625rem 1rem;
    font-size: 0.9375rem;
  }

  .index-btn-primary {
    min-width: 100%;
  }

  /* Próximas competições – touch-friendly rows */
  .upcoming-events-row {
    min-height: 80px;
    padding: 0.875rem 1rem;
    gap: 0.75rem;
  }

  .upcoming-events-row:active {
    opacity: 0.95;
  }

  .upcoming-events-date {
    font-size: 1rem;
    min-width: 2.5rem;
  }

  .upcoming-events-title {
    font-size: 0.875rem;
    line-height: 1.3;
  }

  .upcoming-events-subtitle {
    font-size: 0.75rem;
  }

  /* Últimas notícias – list */
  .index-list-item {
    padding: 0.875rem 0;
    min-height: 44px;
    gap: 0.75rem;
  }

  .index-list-title {
    font-size: 0.875rem;
  }

  .index-list-meta,
  .index-list-date {
    font-size: 0.75rem;
  }
}

/* Index – very small screens (≤375px) */
@media (max-width: 375px) {
  .index-page .index-hero {
    padding: 0.75rem 0 1.25rem;
  }

  .index-page .index-grid {
    gap: 0.75rem;
  }

  .index-card-header {
    padding: 0.75rem 0.875rem;
  }

  .index-card-body {
    padding: 0.875rem;
  }

  .events-in-progress-slide > .event-in-progress {
    padding: 0.875rem;
  }

  .upcoming-events-row {
    min-height: 72px;
    padding: 0.75rem 0.875rem;
  }

  .upcoming-events-title {
    font-size: 0.8125rem;
  }
}