/* Mundialito Callejero de la Gente 2026 - 100% Responsivo */

:root {
  --purple: #6b2d9e;
  --pink: #e91e8c;
  --blue: #1a5fb4;
  --green: #26a269;
  --dark: #1e1e2e;
  --light: #f5f5f7;
}

* {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100vh;
  font-family: 'Source Sans 3', sans-serif;
  background: linear-gradient(135deg, #1e1e2e 0%, #2d2d44 100%);
  color: var(--dark);
}

body {
  padding: 12px;
}

.container {
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  background: #fff;
  border-radius: 16px;
  padding: clamp(16px, 4vw, 32px);
  box-shadow: 0 8px 32px rgba(0,0,0,0.3);
}

.header {
  text-align: center;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 3px solid var(--purple);
}

.logo {
  max-width: 100%;
  height: auto;
  max-height: 140px;
  object-fit: contain;
  margin-bottom: 12px;
}

.header h1 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.8rem;
  color: var(--purple);
  margin: 0 0 4px;
}

.subtitle {
  font-size: 0.95rem;
  color: #555;
  margin: 0;
}

.instructions {
  background: #f8f4fc;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
  border-left: 4px solid var(--pink);
}

.instructions h2 {
  font-family: 'Oswald', sans-serif;
  font-size: 1.2rem;
  margin: 0 0 12px;
  color: var(--dark);
}

.instructions ol {
  margin: 0;
  padding-left: 20px;
  line-height: 1.7;
  color: #333;
}

.instructions li {
  margin-bottom: 6px;
}

.fieldset {
  border: 2px solid #e0e0e0;
  border-radius: 12px;
  padding: 20px;
  margin-bottom: 24px;
}

.fieldset legend {
  font-family: 'Oswald', sans-serif;
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--purple);
  padding: 0 12px;
}

.form-group {
  margin-bottom: 16px;
}

.form-group label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: #333;
}

.form-group input[type="text"],
.form-group input[type="tel"],
.form-group input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 2px solid #ddd;
  border-radius: 8px;
  font-size: 1rem;
  font-family: inherit;
  transition: border-color 0.2s;
}

.form-group input:focus {
  outline: none;
  border-color: var(--purple);
}

.form-group input:invalid:not(:placeholder-shown) {
  border-color: #c0392b;
}

.form-group input:valid:not(:placeholder-shown) {
  border-color: var(--green);
}

.form-row {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.form-row .form-group {
  flex: 1;
  min-width: 140px;
}

.form-row .form-group.flex-2 {
  flex: 2;
  min-width: 180px;
}

.composicion-info {
  margin: 0 0 16px;
  padding: 10px 14px;
  background: #f0f7f0;
  border-radius: 8px;
  border-left: 4px solid var(--green);
  font-size: 0.95rem;
}

.composicion-info.invalido {
  background: #fff0f0;
  border-left-color: #c0392b;
}

.jugador-card {
  background: #fafafa;
  border-radius: 10px;
  padding: 18px;
  margin-bottom: 20px;
  border: 1px solid #eee;
}

.jugador-card h3 {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  color: var(--purple);
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid #eee;
}

/* Dirección con colonia autocomplete */
.direccion-fields {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.colonia-autocomplete {
  position: relative;
}

.colonia-input {
  width: 100%;
}

.colonia-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  max-height: 200px;
  overflow-y: auto;
  background: #fff;
  border: 2px solid var(--purple);
  border-radius: 8px;
  list-style: none;
  margin: 4px 0 0;
  padding: 0;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  display: none;
}

.colonia-dropdown.visible {
  display: block;
}

.colonia-dropdown li {
  padding: 10px 14px;
  cursor: pointer;
  font-size: 0.95rem;
  border-bottom: 1px solid #eee;
}

.colonia-dropdown li:last-child {
  border-bottom: none;
}

.colonia-dropdown li:hover {
  background: #f0e6f8;
}

.cp-input {
  background: #f5f5f5 !important;
  cursor: default;
}

.checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-weight: 500;
}

.checkbox-label input {
  width: 18px;
  height: 18px;
}

.form-actions {
  margin-top: 24px;
  text-align: center;
}

.btn {
  padding: 12px 28px;
  font-size: 1.1rem;
  font-family: 'Oswald', sans-serif;
  font-weight: 600;
  border: none;
  border-radius: 8px;
  cursor: pointer;
  transition: transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: linear-gradient(135deg, var(--purple), var(--pink));
  color: #fff;
  box-shadow: 0 4px 14px rgba(107, 45, 158, 0.4);
}

.btn-primary:hover {
  box-shadow: 0 6px 20px rgba(107, 45, 158, 0.5);
}

.btn-secondary {
  background: var(--purple);
  color: #fff;
  margin-top: 12px;
}

/* Modal folio */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 12px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal.hidden {
  display: none;
}

.modal-content {
  background: #fff;
  border-radius: 16px;
  padding: 32px;
  max-width: 400px;
  width: 100%;
  text-align: center;
  box-shadow: 0 12px 40px rgba(0,0,0,0.3);
  margin: auto;
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: none;
  background: #eee;
  color: #333;
  font-size: 1.8rem;
  line-height: 1;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  z-index: 10;
}

.modal-close:hover {
  background: #ddd;
}

.modal-content h2 {
  font-family: 'Oswald', sans-serif;
  color: var(--green);
  margin: 0 0 16px;
}

.folio-label {
  font-size: 0.95rem;
  margin: 8px 0 4px;
}

.folio-value {
  font-family: 'Oswald', sans-serif;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--purple);
  letter-spacing: 1px;
  margin: 0 0 16px;
}

.folio-warning {
  font-size: 0.9rem;
  color: #c0392b;
  margin: 12px 0;
}

/* Modal Instrucciones - más ancho para lectura */
.logo-popup {
  display: block;
  max-width: 100%;
  width: min(400px, 90vw);
  height: auto;
  max-height: 220px;
  object-fit: contain;
  margin: 0 auto 20px;
}

.modal-instrucciones .modal-content {
  max-width: min(95vw, 560px);
  text-align: left;
  position: relative;
  max-height: calc(100vh - 24px);
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.modal-instrucciones-content ol {
  margin: 0 0 20px;
  padding-left: 24px;
  line-height: 1.8;
}

.modal-instrucciones-content .btn {
  display: block;
  margin: 0 auto;
  position: sticky;
  bottom: 0;
}

@media (max-width: 480px) {
  .modal {
    padding: 8px;
    align-items: flex-start;
  }
  .modal-instrucciones .modal-content {
    max-height: calc(100vh - 16px);
    padding: 40px 20px 24px;
  }
  .modal-instrucciones .modal-close {
    top: 8px;
    right: 8px;
    width: 44px;
    height: 44px;
    font-size: 2rem;
  }
}

.header-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
  margin-top: 12px;
}

.btn-link {
  background: transparent;
  color: var(--purple);
  text-decoration: underline;
  font-size: 0.9rem;
  padding: 8px 0;
}

.btn-link:hover {
  color: var(--pink);
}

/* 100% Responsivo */
@media (max-width: 768px) {
  body {
    padding: 8px;
  }

  .header h1 {
    font-size: 1.5rem;
  }

  .form-row {
    flex-direction: column;
  }

  .form-row .form-group,
  .form-row .form-group.flex-2 {
    flex: 1 1 100%;
    min-width: 100%;
  }

  .jugador-card {
    padding: 14px;
  }

  .direccion-fields {
    width: 100%;
  }

  .modal-content {
    margin: 10px;
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 16px;
    border-radius: 12px;
  }

  .btn {
    width: 100%;
    padding: 14px;
  }
}
