/* ====== Tema base: oscuro marino ====== */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
:root{
  --bg: #0b1c2c;          /* marino oscuro */
  --bg-soft: #12263a;     /* tarjetas / secciones */
  --ink: #ffffff;         /* texto principal */
  --muted: #cbd5e1;       /* texto secundario */
  --line: #264155;        /* líneas sutiles */

  --field-bg: #0f2135;    /* fondo inputs */
  --field-line: #334155;  /* borde inputs */
  --field-ph: #94a3b8;    /* placeholder */

  --btn: #16a34a;         /* verde activo */
  --btn-hover: #15803d;   /* verde hover */
  --btn-line: #15803d;

  --danger: #dc2626;      /* rojo inactivo */
  --danger-hover: #b91c1c;
  --danger-line: #991b1b;

  --focus: #22d3ee;       /* cian focus */
}

body{
  background: var(--bg);
  color: var(--ink);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, 'Helvetica Neue', Arial, sans-serif;
  line-height: 1.5;
}
a{ color: #93c5fd; text-decoration: none; }
a:hover{ text-decoration: underline; }

.container{ max-width: 960px; margin: 0 auto; padding: 1rem; }

/* ====== Topbar ====== */
.topbar{
  display: flex; align-items: center; justify-content: space-between;
  padding: .75rem 1rem;
  border-bottom: 1px solid var(--line);
  background: var(--bg-soft);
  position: sticky; top: 0;
}
.brand{ font-weight: 700; color: var(--ink); }

/* ====== Tarjetas / Grid ====== */
.card{
  border: 1px solid var(--line);
  border-radius: .75rem;
  padding: 1rem;
  background: var(--bg-soft);
  margin: 1rem 0;
  box-shadow: 0 1px 2px rgba(0,0,0,.25);
}
.grid{
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
}

.muted{ color: var(--muted); }
.error{
  background: rgba(239, 68, 68, .12);
  border: 1px solid rgba(239, 68, 68, .45);
  color: #fecaca;
  padding: .5rem .75rem;
  border-radius: .5rem;
  display: block;
  margin-top: .5rem;
}

/* ====== Formularios ====== */
.field{ display: flex; flex-direction: column; margin: .75rem 0; }
.field > span{ font-size: .9rem; color: var(--muted); margin-bottom: .25rem; }

input[type="text"],
input[type="password"]{
  background: var(--field-bg);
  color: var(--ink);
  border: 1px solid var(--field-line);
  border-radius: .5rem;
  padding: .6rem .8rem;
  font-size: 1rem;
  width: 100%;
}
input::placeholder{ color: var(--field-ph); }

.password{ display: flex; align-items: center; gap: .5rem; }
.password .toggle{
  border: 1px solid var(--field-line);
  border-radius: .5rem;
  padding: .4rem .6rem;
  background: var(--bg-soft);
  color: var(--ink);
  cursor: pointer;
}

/* ====== Botones ====== */
.btn{
  display: inline-block;
  padding: .65rem 1.1rem;
  border-radius: .6rem;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: filter .15s ease, background-color .15s ease, opacity .15s ease, border-color .15s ease;
}
.btn:hover{ filter: brightness(1.05); }

/* Botón verde (activo) */
.btn.primary{
  background: var(--btn);
  border-color: var(--btn-line);
  color: #fff;
}
.btn.primary:hover{ background: var(--btn-hover); }

/* Botón rojo (inactivo) */
.btn.danger{
  background: var(--danger); !important
  border-color: var(--danger-line); !important
  color: #fff; !important
  opacity: .9;
}
.btn.danger:hover{ background: var(--danger-hover); }

/* Disabled */
.btn:disabled{
  opacity: .7;
  cursor: not-allowed;
}

/* Centrado del botón en formularios */
.actions{
  margin-top: 1rem;
  display: flex;
  justify-content: center;   /* centrado horizontal */
}

/* ====== Accesibilidad ====== */
:focus,
button:focus,
input:focus,
a:focus{
  outline: 2px solid var(--focus);
  outline-offset: 2px;
  border-color: var(--focus);
}

/* ====== Páginas ====== */
.page-login main{
  display: grid; place-items: center;
  min-height: 100vh; padding: 1rem;
}

/* ====== Utilidades opcionales ====== */
.text-center{ text-align: center; }
.w-100{ width: 100%; }
.mt-0{ margin-top: 0; }
.mt-1{ margin-top: .25rem; }
.mt-2{ margin-top: .5rem; }
.mt-3{ margin-top: 1rem; }
