/* Generador de QR institucional - Gobierno de Ecatepec de Morelos */

:root {
  --guinda: #7b1f3a;
  --guinda-osc: #5d1029;
  --dorado: #c9a24b;
  --dorado-cla: #e2c684;
  --tinta: #1f1f1f;
  --gris: #5a5a5a;
  --linea: #d8d2cb;
  --fondo: #f6f3ee;
  --panel: #ffffff;
  --ok: #1b6b4a;
  --error: #a32020;
  --radio: 10px;
  --sombra: 0 2px 10px rgba(0, 0, 0, 0.07);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, sans-serif;
  font-size: 18px;            /* base accesible */
  line-height: 1.55;
  color: var(--tinta);
  background: var(--fondo);
}

/* ------------------------------------------------------------- cabecera */
.barra {
  background: var(--guinda);
  color: #fff;
  border-bottom: 5px solid var(--dorado);
}
.barra-int {
  max-width: 1360px;
  margin: 0 auto;
  padding: 14px 22px;
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}
.barra-logo {
  display: flex;
  align-items: center;
  min-height: 44px;
  flex: 0 0 auto;
}
.barra-logo img { height: 42px; width: auto; display: block; }
.barra h1 { font-size: 1.25rem; margin: 0; font-weight: 700; letter-spacing: .2px; }
.barra .dep { font-size: .82rem; opacity: .85; display: block; font-weight: 400; }
.nav { margin-left: auto; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.nav a, .nav button {
  color: #fff;
  text-decoration: none;
  padding: 11px 16px;         /* area clickeable >= 44px */
  border-radius: var(--radio);
  border: 1px solid rgba(255,255,255,.35);
  background: transparent;
  font-size: .95rem;
  font-family: inherit;
  cursor: pointer;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
}
.nav a:hover, .nav button:hover { background: rgba(255,255,255,.16); }
.nav a.activo { background: #fff; color: var(--guinda); font-weight: 600; border-color: #fff; }
.quien { font-size: .9rem; opacity: .9; }

/* ------------------------------------------------------------ estructura */
.contenido { max-width: 1360px; margin: 0 auto; padding: 26px 22px 60px; }
h2 { font-size: 1.5rem; margin: 0 0 18px; color: var(--guinda-osc); }
h3 { font-size: 1.1rem; margin: 0 0 12px; color: var(--guinda-osc); }

.panel {
  background: var(--panel);
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 22px;
  box-shadow: var(--sombra);
  margin-bottom: 20px;
}

.dos-columnas {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 460px;
  gap: 22px;
  align-items: start;
}
@media (max-width: 1050px) { .dos-columnas { grid-template-columns: 1fr; } }

/* --------------------------------------------------------------- campos */
.campo { margin-bottom: 18px; }
.campo label, .etiqueta {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  font-size: .98rem;
}
.ayuda { font-size: .85rem; color: var(--gris); margin-top: 5px; }

input[type=text], input[type=password], input[type=url], input[type=email],
input[type=number], select, textarea {
  width: 100%;
  padding: 12px 14px;
  font-size: 1rem;
  font-family: inherit;
  border: 2px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
  color: var(--tinta);
  min-height: 48px;
}
input:focus, select:focus, textarea:focus {
  outline: 3px solid var(--dorado);
  outline-offset: 1px;
  border-color: var(--guinda);
}
textarea { min-height: 110px; resize: vertical; }

.fila { display: flex; gap: 14px; flex-wrap: wrap; }
.fila > * { flex: 1 1 180px; }

/* --------------------------------------------------------------- botones */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 22px;
  font-size: 1rem;
  font-family: inherit;
  font-weight: 600;
  border-radius: var(--radio);
  border: 2px solid transparent;
  cursor: pointer;
  text-decoration: none;
}
.btn-principal { background: var(--guinda); color: #fff; }
.btn-principal:hover { background: var(--guinda-osc); }
.btn-secundario { background: #fff; color: var(--guinda); border-color: var(--guinda); }
.btn-secundario:hover { background: #f4e9ed; }
.btn-peligro { background: #fff; color: var(--error); border-color: var(--error); }
.btn-peligro:hover { background: #fbeaea; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-chico { min-height: 40px; padding: 8px 14px; font-size: .9rem; }

/* --------------------------------------------------------------- colores */
.paleta { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 10px; }
.swatch {
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 3px solid #fff;
  box-shadow: 0 0 0 2px var(--linea);
  cursor: pointer;
  padding: 0;
}
.swatch[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--guinda); }
input[type=color] {
  width: 70px; height: 48px; padding: 3px;
  border: 2px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
  cursor: pointer;
}

/* ---------------------------------------------------------- interruptor */
.switch { display: flex; align-items: center; gap: 12px; min-height: 44px; cursor: pointer; }
.switch input { width: 24px; height: 24px; accent-color: var(--guinda); cursor: pointer; }
.switch span { font-weight: 600; }

/* ---------------------------------------------------------------- logos */
.rejilla-logos { display: flex; gap: 12px; flex-wrap: wrap; }
.opcion-logo {
  width: 92px;
  border: 3px solid var(--linea);
  border-radius: var(--radio);
  background: #fff;
  padding: 8px;
  cursor: pointer;
  text-align: center;
  font-size: .72rem;
  color: var(--gris);
  min-height: 44px;
}
.opcion-logo img { width: 100%; height: 58px; object-fit: contain; display: block; }
.opcion-logo[aria-pressed="true"] { border-color: var(--guinda); background: #fdf6f8; color: var(--guinda); font-weight: 600; }
.opcion-logo .sin { height: 58px; display: flex; align-items: center; justify-content: center; font-size: 1.6rem; color: var(--linea); }

/* -------------------------------------------------------------- preview */
.previo { position: sticky; top: 20px; }
.lienzo {
  background:
    linear-gradient(45deg, #eee 25%, transparent 25%, transparent 75%, #eee 75%),
    linear-gradient(45deg, #eee 25%, #fff 25%, #fff 75%, #eee 75%);
  background-size: 22px 22px;
  background-position: 0 0, 11px 11px;
  border: 1px solid var(--linea);
  border-radius: var(--radio);
  padding: 18px;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 340px;
}
.lienzo svg { width: 100%; height: auto; max-width: 400px; display: block; }
.lienzo .vacio { color: var(--gris); text-align: center; font-size: .95rem; }

/* --------------------------------------------------------------- tablas */
table { width: 100%; border-collapse: collapse; font-size: .95rem; }
th, td { padding: 12px 10px; text-align: left; border-bottom: 1px solid var(--linea); vertical-align: middle; }
th { background: #f0ebe4; color: var(--guinda-osc); font-size: .85rem; text-transform: uppercase; letter-spacing: .4px; }
tr:hover td { background: #fbf9f6; }
td.mini { font-size: .85rem; color: var(--gris); }
.tabla-scroll { overflow-x: auto; }

/* --------------------------------------------------------------- avisos */
.aviso { padding: 14px 18px; border-radius: var(--radio); margin-bottom: 18px; font-weight: 600; border: 2px solid; }
.aviso-ok { background: #eaf6f0; color: var(--ok); border-color: var(--ok); }
.aviso-error { background: #fbeaea; color: var(--error); border-color: var(--error); }

.pill { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: .78rem; font-weight: 700; }
.pill-admin { background: var(--guinda); color: #fff; }
.pill-user { background: #e8e3db; color: var(--gris); }
.pill-off { background: #f3d6d6; color: var(--error); }

/* ---------------------------------------------------------------- login */
/* Fondo guinda a toda la pantalla, solo en la pantalla de acceso */
body.pagina-login {
  background: var(--guinda);
  background-image:
    radial-gradient(circle at 50% 0%, rgba(255, 255, 255, .10), transparent 60%),
    linear-gradient(160deg, var(--guinda) 0%, var(--guinda-osc) 100%);
  min-height: 100vh;
}
body.pagina-login .contenido { padding-top: 0; }

.login-caja { max-width: 430px; margin: 7vh auto; }
.login-caja .panel {
  padding: 34px 32px 32px;
  border: 0;
  border-top: 5px solid var(--dorado);
  box-shadow: 0 14px 40px rgba(0, 0, 0, .3);
}
.login-caja h2 { text-align: center; font-size: 1.35rem; margin-bottom: 4px; }
.login-logo { text-align: center; margin-bottom: 18px; }
.login-logo img { width: 100%; max-width: 260px; height: auto; display: inline-block; }
.login-pie {
  text-align: center;
  color: rgba(255, 255, 255, .8);
  font-size: .85rem;
  margin-top: 20px;
}

.sep { height: 1px; background: var(--linea); margin: 22px 0; border: 0; }
details.bloque { border: 1px solid var(--linea); border-radius: var(--radio); padding: 12px 16px; margin-bottom: 14px; background: #fff; }
details.bloque summary { font-weight: 600; cursor: pointer; min-height: 44px; display: flex; align-items: center; color: var(--guinda-osc); }
