/* ============================================================
   AFUTBAL APP — Estilos globales
   Prohibido Rendirse SL
   ============================================================ */

/* --- Variables de marca ------------------------------------ */
:root {
  /* Marca (configurable desde Configuración → Apariencia) */
  --verde:       #6AA842;
  --verde-oscuro:#4d7a2f;

  /* Neutros refinados (aspecto profesional) */
  --blanco:      #ffffff;
  --negro:       #111827;
  --gris-claro:  #f4f6f8;
  --gris-texto:  #6b7280;
  --borde:       #e6e8ec;
  --rojo:        #e5484d;
  --naranja:     #f5a524;

  --radio:       12px;
  --radio-sm:    8px;
  --sombra:      0 1px 2px rgba(16,24,40,0.04), 0 1px 3px rgba(16,24,40,0.08);
  --sombra-md:   0 4px 16px rgba(16,24,40,0.08);
  --transicion:  0.18s ease;

  --fuente:      'Inter', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* --- Reset base -------------------------------------------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--fuente);
  background: var(--gris-claro);
  color: var(--negro);
  line-height: 1.5;
  min-height: 100vh;
}

/* --- Tipografía -------------------------------------------- */
h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
}

h1 { font-size: 1.6rem; }
h2 { font-size: 1.3rem; }
h3 { font-size: 1.1rem; }

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

a:hover {
  color: var(--verde-oscuro);
}

/* --- Layout principal -------------------------------------- */
.contenedor {
  width: 100%;
  max-width: 480px;   /* App móvil primero */
  margin: 0 auto;
  padding: 0 16px;
}

/* --- Tarjeta (card) ---------------------------------------- */
.card {
  background: var(--blanco);
  border-radius: var(--radio);
  box-shadow: var(--sombra);
  padding: 24px;
  margin-bottom: 16px;
}

/* --- Botones ----------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 14px 20px;
  border: none;
  border-radius: var(--radio);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background var(--transicion), transform var(--transicion);
  text-align: center;
}

.btn:active {
  transform: scale(0.98);
}

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

.btn-primary:hover {
  background: var(--verde-oscuro);
}

.btn-secondary {
  background: var(--gris-claro);
  color: var(--negro);
  border: 1px solid #ddd;
}

.btn-peligro {
  background: var(--rojo);
  color: var(--blanco);
}

/* --- Formularios ------------------------------------------- */
.form-grupo {
  margin-bottom: 16px;
}

.form-grupo label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--gris-texto);
}

.form-grupo input,
.form-grupo select,
.form-grupo textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid #ddd;
  border-radius: var(--radio);
  font-size: 1rem;
  font-family: var(--fuente);
  color: var(--negro);
  background: var(--blanco);
  transition: border-color var(--transicion);
  appearance: none;
}

.form-grupo input:focus,
.form-grupo select:focus,
.form-grupo textarea:focus {
  outline: none;
  border-color: var(--verde);
}

.form-grupo textarea {
  resize: vertical;
  min-height: 100px;
}

/* --- Alertas ----------------------------------------------- */
.alerta {
  padding: 12px 16px;
  border-radius: var(--radio);
  font-size: 0.9rem;
  margin-bottom: 16px;
}

.alerta-error   { background: #fdecea; color: #b71c1c; border-left: 4px solid var(--rojo); }
.alerta-ok      { background: #e8f5e9; color: #1b5e20; border-left: 4px solid var(--verde); }
.alerta-aviso   { background: #fff8e1; color: #e65100; border-left: 4px solid var(--naranja); }

/* --- Cabecera de página ------------------------------------ */
.cabecera {
  background: var(--verde);
  color: var(--blanco);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.cabecera h1 {
  font-size: 1.1rem;
  font-weight: 700;
}

.cabecera .btn-salir {
  background: rgba(255,255,255,0.2);
  border: none;
  color: var(--blanco);
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 0.85rem;
  cursor: pointer;
}

/* --- Navegación inferior (móvil) --------------------------- */
.nav-inferior {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--blanco);
  border-top: 1px solid #eee;
  display: flex;
  box-shadow: 0 -2px 10px rgba(0,0,0,0.08);
  z-index: 100;
}

.nav-inferior a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 4px;
  font-size: 0.7rem;
  color: var(--gris-texto);
  gap: 4px;
}

.nav-inferior a.activo {
  color: var(--verde);
  font-weight: 600;
}

.nav-inferior a svg {
  width: 22px;
  height: 22px;
}

/* --- Contenido principal (espacio para nav inferior) ------- */
.main {
  padding: 16px;
  padding-bottom: 80px; /* espacio nav inferior */
}

/* --- Badge / etiqueta -------------------------------------- */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 600;
}

.badge-verde   { background: #e8f5e9; color: var(--verde-oscuro); }
.badge-rojo    { background: #fdecea; color: var(--rojo); }
.badge-naranja { background: #fff8e1; color: #e65100; }
.badge-gris    { background: #eee;    color: var(--gris-texto); }

/* --- Lista de ítems ---------------------------------------- */
.lista-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
  border-bottom: 1px solid #f0f0f0;
}

.lista-item:last-child {
  border-bottom: none;
}

/* --- Spinner de carga -------------------------------------- */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #eee;
  border-top-color: var(--verde);
  border-radius: 50%;
  animation: girar 0.7s linear infinite;
  margin: 20px auto;
}

@keyframes girar {
  to { transform: rotate(360deg); }
}

/* --- Logo en login ----------------------------------------- */
.logo-login {
  text-align: center;
  margin-bottom: 28px;
}

.logo-login h1 {
  color: var(--verde);
  font-size: 2rem;
  letter-spacing: -1px;
}

.logo-login p {
  color: var(--gris-texto);
  font-size: 0.9rem;
}

/* --- Escritorio: contener el ancho y aprovechar el espacio - */
@media (min-width: 768px) {
  /* La cabecera verde ocupa todo el ancho, pero su contenido se alinea
     con el resto centrando el bloque a un máximo cómodo. */
  .cabecera {
    padding-left:  max(20px, calc((100% - 920px) / 2));
    padding-right: max(20px, calc((100% - 920px) / 2));
  }
  /* Contenido principal de los dashboards: columna ancha centrada,
     no estirada de lado a lado. */
  .main {
    max-width: 920px;
    margin: 0 auto;
  }
}

/* --- Utilidades -------------------------------------------- */
.text-center  { text-align: center; }
.text-verde   { color: var(--verde); }
.text-rojo    { color: var(--rojo); }
.text-gris    { color: var(--gris-texto); }
.mt-8         { margin-top: 8px; }
.mt-16        { margin-top: 16px; }
.mt-24        { margin-top: 24px; }
.mb-8         { margin-bottom: 8px; }
.mb-16        { margin-bottom: 16px; }
.oculto       { display: none !important; }
.negrita      { font-weight: 700; }
.w-100        { width: 100%; }
