/* ===== Base ===== */
:root{
  --bg1:#1c92d2;
  --bg2:#83d8e9;
  --panel:#0f172a;
  --field:#1e293b;
  --text:#ffffff;
  --muted:#cbd5e1;
  --primary:#2563eb;
  --primary-hover:#4470e9;
  --focus:#60a5fa;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100svh; /* usa svh para móviles */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 16px; /* respiración en móviles */
  background: linear-gradient(to right, var(--bg1), var(--bg2));
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  color: var(--text);
}

/* ===== Card de login ===== */
.login-container {
  background-color: var(--panel);
  padding: 30px 40px;
  border-radius: 12px;
  width: 360px;
  max-width: min(100%, 420px);
  text-align: center;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}

.login-container h2 {
  margin: 0 0 20px;
  font-size: clamp(1.1rem, 2.5vw, 1.35rem);
  font-weight: 700;
}

/* ===== Formulario ===== */
form {
  display: flex;
  flex-direction: column;
  text-align: left;
  gap: 12px;
}

label {
  font-size: 14px;
  margin-bottom: 4px;
  color: #e2e8f0;
}

input {
  padding: 12px;
  border: none;
  border-radius: 8px;
  background-color: var(--field);
  color: var(--text);
  font-size: 16px; /* evita zoom en iOS */
}

input::placeholder { color: var(--muted); }

input:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

/* ===== Botón ===== */
button {
  padding: 12px;
  background-color: var(--primary);
  color: var(--text);
  border: none;
  border-radius: 8px;
  cursor: pointer;
  font-weight: 600;
  font-size: 16px; /* evita zoom en iOS */
  transition: transform .08s ease-in-out, background-color .15s ease-in-out, box-shadow .15s ease-in-out;
}

button:hover { background-color: var(--primary-hover); }
button:active { transform: translateY(1px); }
button:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(96,165,250,.25);
}

/* ===== Vista móvil (<=480px) ===== */
@media (max-width: 480px) {
  body { padding: 12px; }
  .login-container {
    width: 100%;
    padding: 22px 16px;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(0,0,0,.22);
  }
  .login-container h2 { margin-bottom: 14px; }
  label { font-size: 13px; }
}

/* ===== Pantallas bajas / horizontal en móvil ===== */
@media (max-height: 520px) {
  body {
    align-items: flex-start;
  }
  .login-container {
    margin-top: 16px;
    margin-bottom: 16px;
  }
}

/* ===== Respeta reducción de movimiento ===== */
@media (prefers-reduced-motion: reduce) {
  button { transition: none; }
}
