

/* ============================================================
   Tokens
   ============================================================ */
:root {
  --red: #e2001a;
  --red-dark: #c00016;
  --ink: #2c2a29;
  --ink-soft: #4a4744;
  --label: #33312f;
  --border: #c9c6c2;
  --border-focus: #2c2a29;
  --bg-page: #eef1f7;
  --bg-card: #ffffff;
  --radius: 8px;

  /* Sustituto libre cercano a "Cibeles" (fuente propietaria de la marca).
     Si tienes el archivo real, declara su @font-face abajo y cambia el
     primer nombre de esta lista por el suyo. */
  --font: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

/* El atributo [hidden] debe ganar siempre, aunque .field use display:flex */
[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg-page);
  -webkit-font-smoothing: antialiased;
}

/* ============================================================
   Layout · mobile first
   ============================================================ */
.app {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
}

.card {
  position: relative;
  flex: 1;
  background: var(--bg-card);
  padding: 2.5rem 1.5rem 1rem;
  overflow: hidden;
}

/* Esquina curva decorativa (como en el original) */
.card::before {
  content: "";
  position: absolute;
  left: -90px;
  bottom: 40px;
  width: 220px;
  height: 220px;
  border-radius: 50%;
  background: #f6f7f9;
  z-index: 0;
}

.card > * {
  position: relative;
  z-index: 1;
}

/* ============================================================
   Encabezado
   ============================================================ */
.card__header {
  margin-bottom: 1.75rem;
}

.card__greeting {
  margin: 0 0 0.25rem;
  font-size: 1.0625rem;
  color: var(--ink-soft);
}

.card__title {
  margin: 0;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
  color: var(--ink);
}

/* ============================================================
   Formulario
   ============================================================ */
.login {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.field__label {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--label);
}

.field__input {
  width: 100%;
  height: 48px;
  padding: 0 0.875rem;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.field__input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

/* Select con chevron propio */
.select {
  position: relative;
}

.select__control {
  width: 100%;
  height: 48px;
  padding: 0 2.75rem 0 0.875rem;
  font-size: 1rem;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  appearance: none;
  -webkit-appearance: none;
  cursor: pointer;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.select__control:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 1px var(--border-focus);
}

.select__chevron {
  position: absolute;
  top: 50%;
  right: 0.875rem;
  width: 20px;
  height: 20px;
  transform: translateY(-50%);
  color: var(--ink);
  pointer-events: none;
}

/* ============================================================
   Checkbox
   ============================================================ */
.checkbox {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  cursor: pointer;
  user-select: none;
}

.checkbox__input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox__box {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: #fff;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkbox__box svg {
  width: 16px;
  height: 16px;
  opacity: 0;
  transition: opacity 0.12s ease;
}

.checkbox__input:checked + .checkbox__box {
  background: var(--red);
  border-color: var(--red);
}

.checkbox__input:checked + .checkbox__box svg {
  opacity: 1;
}

.checkbox__input:focus-visible + .checkbox__box {
  box-shadow: 0 0 0 2px rgba(226, 0, 26, 0.35);
}

.checkbox__label {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ============================================================
   Botón principal
   ============================================================ */
.btn {
  align-self: center;
  width: 100%;
  max-width: 220px;
  height: 48px;
  margin-top: 0.5rem;
  font-size: 1rem;
  font-weight: 700;
  color: #fff;
  background: var(--red);
  border: none;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.05s ease;
}

.btn:hover {
  background: var(--red-dark);
}

.btn:active {
  transform: translateY(1px);
}

.btn:focus-visible {
  outline: 3px solid rgba(226, 0, 26, 0.4);
  outline-offset: 2px;
}

/* ============================================================
   Animación de aparición de la clave virtual
   ============================================================ */
.field--password {
  animation: slide-in 0.28s ease;
}

@keyframes slide-in {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================================
   Footer
   ============================================================ */
.app__footer {
  background: var(--bg-card);
  padding: 1.25rem 1.5rem 2rem;
  text-align: center;
  border-top: 1px solid #ececec;
}

.app__link {
  font-size: 1.0625rem;
  font-weight: 700;
  color: var(--ink);
  text-decoration: none;
}

.app__link:hover {
  text-decoration: underline;
}

/* ============================================================
   Escritorio · centra la "tarjeta móvil"
   ============================================================ */
@media (min-width: 480px) {
  .app {
    max-width: 420px;
    min-height: 100dvh;
    margin: 0 auto;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
  }
}
