/* ==========================================================================
   Login · Dark Minimal
   - Paleta neutra (negros y grises)
   - Contraste accesible
   - Sin marca explícita; apto para múltiples gimnasios
   - Sin "blur" pesado (mejor rendimiento)
   ========================================================================== */

:root {
  color-scheme: dark;

  /* Paleta base */
  --bg:        #0b0d10;   /* fondo principal */
  --bg-2:      #0f1216;   /* capas */
  --panel:     #12161b;   /* tarjeta */
  --panel-2:   #161b22;   /* bordes sutiles */
  --text:      #e6e7ea;   /* texto primario */
  --muted:     #b5b7bd;   /* texto secundario */
  --border:    #262b33;   /* bordes */
  --ring:      #9aa2ae;   /* foco accesible (gris claro) */

  /* Botones / acentos (neutrales) */
  --primary:   #e6e7ea;   /* texto oscuro sobre panel oscuro */
  --primary-ink:#0b0d10;  /* texto del botón primario */
  --primary-h: #ffffff;   /* hover */

  /* Inputs */
  --input-bg:  #0e1216;
  --input-bd:  #252b33;
  --input-tx:  #e6e7ea;
  --placeholder:#818894;

  /* Alertas */
  --info-bg:   #0f1a29;
  --info-bd:   #2a3a51;
  --info-tx:   #cfe1ff;

  /* Sombra suave */
  --shadow: 0 10px 30px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font: 400 16px/1.55 ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
  color: var(--text);
  background: radial-gradient(1200px 800px at 70% -10%, #151a20 0%, transparent 60%) no-repeat,
              radial-gradient(1000px 700px at 10% 120%, #10151a 0%, transparent 60%) no-repeat,
              var(--bg);
}

/* ===== Layout ===== */
.wrap {
  min-height: 100%;
  display: grid;
  place-items: center;
  padding: 32px 16px;
}

.panel {
  width: 100%;
  max-width: 440px;
  background: linear-gradient(180deg, var(--panel) 0%, var(--bg-2) 100%);
  border: 1px solid var(--panel-2);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
  position: relative;
  isolation: isolate;
}

/* Sutileza de brillo lateral (estético, sin branding) */
.panel::before {
  content: "";
  position: absolute; inset: -1px;
  border-radius: inherit;
  pointer-events: none;
  background:
    linear-gradient(135deg, rgba(255,255,255,.06), rgba(255,255,255,0) 40%),
    linear-gradient(315deg, rgba(255,255,255,.03), rgba(255,255,255,0) 60%);
  mask: linear-gradient(#000, transparent 65%);
}

/* ===== Header / Marca ===== */
.panel__header { margin-bottom: 18px; }

.brand {
  display: grid;
  gap: 6px;
  justify-items: start;
}

.brand__logo {
  width: 44px; height: 44px;
  display: grid; place-items: center;
  border-radius: 12px;
  background: #0c1014;
  border: 1px solid var(--border);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.02);
  color: var(--primary);
}

.brand__title {
  margin: 6px 0 0 0;
  font-size: clamp(20px, 3.3vw, 24px);
  font-weight: 700;
  letter-spacing: .2px;
}

.brand__sub {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

/* ===== Alert ===== */
.alert {
  margin-top: 14px;
  display: grid;
  grid-template-columns: 20px 1fr;
  gap: 10px;
  align-items: start;
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--info-bg);
  color: var(--info-tx);
  border: 1px solid var(--info-bd);
  font-size: 14px;
}

/* ===== Form ===== */
.form { display: grid; gap: 14px; margin-top: 8px; }

.field {
  display: grid;
  gap: 8px;
}

.field__label {
  color: var(--muted);
  font-size: 13px;
}

.field__input {
  width: 100%;
  border-radius: 12px;
  border: 1px solid var(--input-bd);
  background: var(--input-bg);
  color: var(--input-tx);
  padding: 12px 14px;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .05s ease;
  caret-color: var(--text);
}

.field__input::placeholder { color: var(--placeholder); }

.field__input:focus {
  border-color: var(--ring);
  box-shadow: 0 0 0 3px rgba(154,162,174,.28);
}

.field__input:active { transform: translateY(0.5px); }

/* Mostrar/ocultar contraseña */
.field__password {
  position: relative;
  display: grid;
}
.field__password .toggle {
  position: absolute;
  right: 8px; top: 50%;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--muted);
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  cursor: pointer;
  transition: background-color .15s ease, color .15s ease;
}
.field__password .toggle:hover { background: #141a20; color: var(--text); }
.field__password .toggle:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* Botón principal */
.btn {
  --btn-h: 46px;
  height: var(--btn-h);
  padding: 0 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  display: inline-grid;
  grid-auto-flow: column;
  align-items: center;
  gap: 10px;
  font-weight: 600;
  letter-spacing: .2px;
  cursor: pointer;
  transition: transform .05s ease, box-shadow .2s ease, background-color .2s ease, border-color .2s ease;
}

.btn--primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: #2a2f37;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}
.btn--primary:hover { background: var(--primary-h); }
.btn--primary:active { transform: translateY(1px); }
.btn--primary:focus-visible {
  outline: 3px solid rgba(255,255,255,.5);
  outline-offset: 2px;
}

/* Footer */
.panel__footer {
  margin-top: 18px;
  padding-top: 12px;
  border-top: 1px dashed var(--border);
  color: var(--muted);
  text-align: center;
  font-size: 12px;
}

/* ===== Accesibilidad ===== */
:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
}

/* ===== Autofill (Chrome) ===== */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--input-tx);
  transition: background-color 99999s ease-in-out 0s;
  box-shadow: 0 0 0px 1000px var(--input-bg) inset;
  border: 1px solid var(--input-bd);
}

/* ===== Responsivo ===== */
@media (max-width: 420px) {
  .panel { padding: 22px; border-radius: 16px; }
  .btn { --btn-h: 44px; }
}

/* ===== Animaciones respetuosas ===== */
@media (prefers-reduced-motion: no-preference) {
  .panel {
    animation: fadeUp .35s ease both;
  }
  @keyframes fadeUp {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}
/* ===== Fix botón Entrar ===== */
.btn {
  /* reemplazamos grid por flex para centrar mejor */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;

  width: auto;                 /* por defecto */
  line-height: 1;              /* evita desajuste vertical */
  padding-inline: 18px;
  -webkit-font-smoothing: antialiased;
}

.btn--block { width: 100%; }   /* usa esta clase en el botón para ocupar todo el ancho */

.btn--primary {
  background: var(--primary);
  color: var(--primary-ink);
  border-color: #2a2f37;
  box-shadow: 0 8px 18px rgba(0,0,0,.35);
}

.btn--primary:hover,
.btn--primary:focus-visible {
  background: var(--primary-h);
  border-color: #3a4049;
  box-shadow: 0 10px 22px rgba(0,0,0,.42);
}

.btn--primary:active {
  transform: translateY(1px);
  box-shadow: 0 6px 14px rgba(0,0,0,.35);
}

/* icono dentro del botón (FA/SVG) bien centrado */
.btn i, .btn svg {
  display: inline-block;
  vertical-align: middle;
  height: 1em;
  width: 1em;
}
