.container {
  width: 100%;
  max-width: 460px;
  padding: 20px;
}

body {
  margin: 0;
  font-family: var(--font-family);
  background: var(--color-background);
  color: var(--color-text);
  font-size: var(--font-base);
  display: flex;
  justify-content: center;
  min-height: 100vh;
  padding-bottom: 10rem;
  /* 💡 espacio extra para no tapar nada con nav y botones fijos */
}

h2 {
  text-align: center;
  margin-bottom: 20px;
  color: var(--color-primary);
  font-size: 1.5rem;
}

.card {
  background: var(--color-surface);
  padding: 16px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 16px;
}

label {
  display: block;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--color-text);
}

input,
select,
date,
time {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: var(--color-surface);
  color: var(--color-text);
  font-size: 1em;
  box-sizing: border-box;
}

input:invalid,
select:invalid {
  border-color: var(--color-alerta);
}

.feedback {
  font-size: 0.9em;
  margin-top: 6px;
  color: var(--color-success);
}

.error {
  color: var(--color-alerta);
}

.botones {
  margin-top: 20px;
}

.boton-ancho {
  width: 100%;
  padding: 14px;
  font-size: 1em;
  border: none;
  border-radius: var(--radius);
  font-weight: bold;
  cursor: pointer;
  transition: background 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
}

.doble-boton {
  display: flex;
  gap: 10px;
}

.doble-boton button {
  flex: 1;
}

button img {
  width: 28px;
  height: 28px;
  margin-right: 8px;
}

.guardar {
  background: var(--color-primary);
  color: var(--color-surface);
}

.guardar:hover {
  background: var(--color-primary-hover);
}

.volver {
  background: var(--color-muted);
  color: var(--color-surface);
}

.volver:hover {
  filter: brightness(1.2);
}

.mensaje {
  text-align: center;
  margin-top: 16px;
  font-size: 0.95em;
}

input:focus,
select:focus {
  outline: none;
  border-color: var(--color-primary);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.25);
}

.card input:disabled,
.card select:disabled {
  opacity: 0.6;
  background-color: var(--color-muted);
  cursor: not-allowed;
}

.botones-sticky {
  position: sticky;
  bottom: 7.5rem;
  z-index: 100;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  max-width: 460px;
  margin: 0 auto;
}

/* ✅ Modo PWA (cuando sticky no funciona en móviles instalados como app) */
body.pwa .botones-sticky {
  position: fixed;
  bottom: 7.5rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 460px;
  padding: 0.5rem 1rem;
  background: transparent;
  border: none;
  box-shadow: none;
  z-index: 9999;
}

.botones-sticky .doble-boton {
  display: flex;
  gap: 10px;
}

.botones-sticky button {
  flex: 1;
  font-size: 1rem;
}

/* 🧽 Espacio final para que no se tape en ningún caso */
form.form-padding-bottom::after {
  content: "";
  display: block;
  height: 9rem;
}

body.pwa form.form-padding-bottom::after {
  height: 10rem;
}

@media (max-width: 600px) {
  form.form-padding-bottom::after {
    height: 10rem;
  }
}

/* Limpieza adicional */
body {
  padding-bottom: 0 !important;
}