@import url('https://fonts.googleapis.com/css2?family=Baloo+2:wght@500;600;700&family=Comic+Neue:wght@400;700&display=swap');

:root {
  --primary: #F97316;
  --secondary: #FB923C;
  --cta: #2563EB;
  --cta-press: #1D4ED8;
  --bg: #FFF7ED;
  --card-bg: #FFFFFF;
  --text: #431407;
  --text-muted: #7C2D12;
  --border: #9A3412;
  --danger: #DC2626;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Comic Neue', sans-serif;
  font-size: 16px;
  line-height: 1.6;
  max-width: 480px;
  margin: 0 auto;
  padding: 20px 16px 48px;
  background: var(--bg);
  color: var(--text);
}

h1, h2, strong {
  font-family: 'Baloo 2', sans-serif;
}

h1 {
  text-align: center;
  color: var(--primary);
  font-size: 30px;
  margin: 4px 0 20px;
}

.icon {
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
}

/* -------- navegación (misma en las dos páginas, un solo login) -------- */
.nav {
  display: flex;
  gap: 8px;
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 18px;
  padding: 6px;
  margin-bottom: 20px;
  box-shadow: 4px 4px 0 rgba(154, 52, 18, 0.15);
}

.nav a {
  flex: 1;
  text-align: center;
  text-decoration: none;
  color: var(--text-muted);
  font-family: 'Baloo 2', sans-serif;
  font-weight: 600;
  padding: 10px;
  border-radius: 12px;
  cursor: pointer;
  transition: background-color 200ms ease, color 200ms ease;
}

.nav a.activo {
  background: var(--primary);
  color: white;
}

/* -------- tarjetas clay -------- */
.card {
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 16px 18px;
  margin-bottom: 16px;
  box-shadow: 6px 6px 0 rgba(154, 52, 18, 0.15), inset 0 2px 0 rgba(255, 255, 255, 0.6);
}

#estado p {
  margin: 6px 0;
}

.muted {
  color: var(--text-muted);
  font-size: 14px;
}

/* -------- formulario de config -------- */
fieldset {
  border: none;
  padding: 0;
  margin: 0 0 16px;
}

legend {
  font-family: 'Baloo 2', sans-serif;
  font-weight: 600;
  color: var(--primary);
  padding: 0 0 8px;
  width: 100%;
}

fieldset label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 15px;
}

fieldset label:last-child {
  margin-bottom: 0;
}

input[type="number"] {
  width: 90px;
  font-family: 'Comic Neue', sans-serif;
  font-size: 16px;
  padding: 8px 10px;
  border: 2px solid var(--secondary);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
}

input[type="number"]:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
}

#form-config button[type="submit"] {
  width: 100%;
}

.botones-debug {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}

.botones-debug button {
  flex: 1 1 auto;
  min-height: 44px;
  font-size: 14px;
  padding: 8px 12px;
  border-width: 2px;
  box-shadow: 3px 3px 0 rgba(29, 78, 216, 0.3);
}

/* -------- login -------- */
.login-wrap {
  min-height: 70vh;
  display: flex;
  align-items: center;
  justify-content: center;
}

.login-card {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#form-login {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 10px;
}

#form-login input {
  font-family: 'Comic Neue', sans-serif;
  font-size: 18px;
  padding: 14px 16px;
  border: 3px solid var(--secondary);
  border-radius: 16px;
  background: var(--bg);
  color: var(--text);
  text-align: center;
}

#form-login input:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 1px;
}

.error-msg {
  color: var(--danger);
  font-size: 14px;
  min-height: 20px;
  margin: 0;
}

/* -------- botones clay -------- */
.botones {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

button {
  cursor: pointer;
  font-family: 'Baloo 2', sans-serif;
  font-size: 18px;
  font-weight: 600;
  min-height: 56px;
  padding: 12px 18px;
  border: 3px solid var(--cta-press);
  border-radius: 18px;
  background: var(--cta);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 5px 5px 0 rgba(29, 78, 216, 0.3);
  transition: transform 150ms ease, box-shadow 150ms ease, background-color 150ms ease;
}

button:hover {
  background: var(--cta-press);
}

button:active {
  transform: translate(3px, 3px);
  box-shadow: 2px 2px 0 rgba(29, 78, 216, 0.3);
}

button:focus-visible {
  outline: 3px solid var(--primary);
  outline-offset: 2px;
}

button:disabled {
  opacity: 0.6;
  cursor: default;
  transform: none;
}

/* -------- admin: filas de tags -------- */
.tag-row {
  background: var(--card-bg);
  border: 3px solid var(--border);
  border-radius: 20px;
  padding: 14px 18px;
  margin-bottom: 14px;
  box-shadow: 6px 6px 0 rgba(154, 52, 18, 0.15);
}

.tag-row-head {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-size: 18px;
  margin-bottom: 8px;
}

.tag-uids {
  margin: 8px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.uid-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg);
  border: 2px solid var(--secondary);
  border-radius: 10px;
  padding: 4px 6px 4px 10px;
  font-family: monospace;
  font-size: 13px;
  color: var(--text-muted);
}

.uid-chip button {
  min-height: 28px;
  font-size: 13px;
  padding: 2px 8px;
  border-width: 2px;
  border-radius: 8px;
  background: var(--danger);
  border-color: #991B1B;
  box-shadow: none;
  gap: 4px;
}

.tag-row .sin-tag {
  color: var(--text-muted);
  font-size: 14px;
}

.tag-row button[data-asignar] {
  width: 100%;
  font-size: 15px;
  min-height: 44px;
}

.estado-aprendizaje {
  margin-top: 8px;
  font-size: 14px;
  color: var(--text-muted);
  min-height: 20px;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
