/* ===============================
   ESTILOS GENERALES - OLIMPIADAS PERU
   Proyecto académico basado en HTML y CSS
   =============================== */

:root {
  --primary: #0f766e;
  --primary-dark: #115e59;
  --secondary: #1d4ed8;
  --light: #f8fafc;
  --light-alt: #eef6f5;
  --text: #1e293b;
  --muted: #64748b;
  --border: #cbd5e1;
  --white: #ffffff;
  --shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background-color: #f4f7fb;
  line-height: 1.6;
}

img {
  max-width: 100%;
  display: block;
  border-radius: 14px;
}

a {
  color: var(--secondary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

code {
  background: #e2e8f0;
  padding: 2px 6px;
  border-radius: 6px;
}

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.section {
  padding: 72px 0;
}

.section.alt {
  background: linear-gradient(180deg, #f8fbff 0%, #eefbf9 100%);
}

.section-title {
  text-align: center;
  max-width: 860px;
  margin: 0 auto 36px;
}

.section-title h2 {
  margin-bottom: 10px;
  font-size: 2rem;
  color: #0f172a;
}

.section-title p {
  margin: 0;
  color: var(--muted);
}

.card,
.sport-card,
.step-card,
.hero-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
}

.topbar {
  padding: 16px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.logo {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: bold;
  font-size: 1.2rem;
  color: white;
  background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.brand h1 {
  margin: 0;
  font-size: 1.5rem;
  color: #0f172a;
}

.brand p {
  margin: 2px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.search-box {
  display: flex;
  gap: 10px;
}

.search-box input,
.search-box button {
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid var(--border);
  font: inherit;
}

.search-box button {
  background: var(--secondary);
  color: white;
  border-color: var(--secondary);
  cursor: pointer;
}

.main-nav {
  background: #0f172a;
}

.nav-content {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 0;
}

.main-nav a {
  color: #f8fafc;
  font-weight: bold;
}

/* Hero */
.hero {
  padding: 80px 0 56px;
  background:
    radial-gradient(circle at top right, rgba(29, 78, 216, 0.18), transparent 28%),
    radial-gradient(circle at left, rgba(15, 118, 110, 0.18), transparent 26%),
    linear-gradient(180deg, #f8fbff 0%, #f4fffc 100%);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.9fr;
  gap: 28px;
  align-items: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: #dcfce7;
  color: #166534;
  font-weight: bold;
  font-size: 0.9rem;
}

.hero h2 {
  margin: 0 0 16px;
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
  color: #0f172a;
}

.hero p {
  max-width: 64ch;
  color: #334155;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 24px;
}

.btn {
  display: inline-block;
  padding: 12px 18px;
  border-radius: 12px;
  font-weight: bold;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-secondary {
  background: white;
  color: var(--secondary);
  border-color: var(--secondary);
}

.hero-card {
  padding: 24px;
}

.hero-card h3 {
  margin-top: 0;
  color: var(--primary-dark);
}

.hero-card ul {
  margin: 0 0 18px 20px;
  padding: 0;
}

/* Content blocks */
.two-columns {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}

.card {
  padding: 24px;
}

.card h2 {
  margin-top: 0;
  color: var(--primary-dark);
}

.sports-grid,
.steps-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.sport-card,
.step-card {
  padding: 22px 18px;
  text-align: center;
}

.sport-card h3,
.step-card h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.sport-icon {
  font-size: 2rem;
  display: inline-block;
  margin-bottom: 10px;
}

.info-banner {
  margin-top: 24px;
  padding: 16px 18px;
  border-left: 5px solid #f59e0b;
  background: #fff7ed;
  border-radius: 10px;
}

.diagram-box {
  background: white;
  margin: 0;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.diagram-box figcaption {
  margin-top: 12px;
  text-align: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.steps-grid {
  margin-top: 24px;
  grid-template-columns: repeat(3, 1fr);
}

.step-card span {
  width: 46px;
  height: 46px;
  margin: 0 auto 12px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #dbeafe;
  color: #1d4ed8;
  font-weight: bold;
}

/* Form */
.registration-form {
  background: white;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

fieldset {
  border: 1px solid #bfdbfe;
  border-radius: 14px;
  margin-bottom: 22px;
  padding: 18px;
}

legend {
  font-weight: bold;
  color: #1e3a8a;
  padding: 0 10px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 18px;
}

label,
.group-title {
  display: block;
  margin-bottom: 8px;
  font-weight: bold;
  color: #0f172a;
}

input,
select,
textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font: inherit;
  background: white;
}

textarea {
  resize: vertical;
  min-height: 130px;
}

input:focus,
select:focus,
textarea:focus {
  outline: 2px solid rgba(29, 78, 216, 0.2);
  border-color: #60a5fa;
}

.checkbox-group label,
.registration-form input[type="radio"] + label {
  font-weight: normal;
}

.checkbox-group label,
.radio-group label {
  display: block;
  margin-bottom: 8px;
}

.checkbox-group input,
.registration-form input[type="radio"] {
  width: auto;
  margin-right: 8px;
}

.form-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

/* Tables */
.table-wrapper {
  overflow-x: auto;
  background: white;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 14px;
  margin-bottom: 24px;
}

table {
  width: 100%;
  border-collapse: collapse;
  min-width: 720px;
}

caption {
  caption-side: top;
  font-weight: bold;
  font-size: 1.05rem;
  margin-bottom: 10px;
  color: var(--primary-dark);
  text-align: left;
}

th,
td {
  border: 1px solid #cbd5e1;
  padding: 12px 10px;
  text-align: center;
}

thead th {
  background: #0f766e;
  color: white;
}

tbody tr:nth-child(even) {
  background: #f8fafc;
}

tbody th[scope="row"] {
  background: #eff6ff;
  color: #1e3a8a;
}

tfoot td {
  background: #ecfeff;
  text-align: left;
  font-style: italic;
}

/* Footer */
.site-footer {
  background: #0f172a;
  color: #e2e8f0;
  padding: 50px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 24px;
}

.site-footer h3 {
  color: white;
  margin-top: 0;
}

.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.site-footer li + li {
  margin-top: 8px;
}

.site-footer a {
  color: #bfdbfe;
}

/* Accessibility */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Responsive */
@media (max-width: 900px) {
  .hero-grid,
  .two-columns,
  .form-grid,
  .footer-grid,
  .sports-grid,
  .steps-grid {
    grid-template-columns: 1fr;
  }

  .topbar {
    flex-direction: column;
    align-items: flex-start;
  }

  .search-box {
    width: 100%;
  }

  .search-box input {
    flex: 1;
  }

  .nav-content {
    justify-content: center;
  }
}
