/* Login y registro (iniciar-sesion.php, registro.php).
   Estructura del diseño original (tarjeta centrada, campos grises
   redondeados, botones en píldora) con la paleta azul marino del sitio. */
:root {
  --auth-navy: #102746;
  --auth-navy-dark: #0a1d36;
  --auth-ink: #111;
  --auth-text: #333;
  --auth-muted: #6b7280;
  --auth-field: #f4f4f4;
  --auth-red: #b42318;
  --auth-green: #067647;
}

* { box-sizing: border-box; }

html, body {
  min-height: 100%;
  margin: 0;
  background: #f5f5f5;
  color: var(--auth-text);
  font-family: Montserrat, Arial, Helvetica, sans-serif;
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--auth-navy); }

.auth {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 24px 16px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 36px;
  border-radius: 20px;
  background: #fff;
}

.auth-card--wide { max-width: 860px; }

.auth__logo { display: block; width: 180px; margin: 0 auto 32px; }
.auth__logo img { display: block; width: 100%; height: auto; }

.auth__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}

.auth__title {
  margin: 0;
  color: var(--auth-ink);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .01em;
  text-transform: uppercase;
}

.auth__head-link {
  color: var(--auth-ink);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.auth__intro { margin: 0 0 24px; color: var(--auth-text); font-size: 15px; }
.auth__intro strong { display: block; margin-bottom: 2px; color: var(--auth-ink); font-size: 14px; text-transform: uppercase; }

.auth__section-title {
  margin: 0 0 16px;
  color: var(--auth-ink);
  font-size: 16px;
  font-weight: 700;
}

/* Campos */
.auth-grid { display: grid; gap: 0 16px; }
@media (min-width: 560px) { .auth-grid--2 { grid-template-columns: 1fr 1fr; } }
@media (min-width: 760px) { .auth-columns { display: grid; grid-template-columns: 1fr 1fr; gap: 0 36px; } }

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 6px;
  padding-left: 14px;
  color: var(--auth-text);
  font-size: 14px;
  font-weight: 700;
}

.field input,
.field select {
  display: block;
  width: 100%;
  height: 52px;
  padding: 0 20px;
  border: 1px solid var(--auth-field);
  border-radius: 26px;
  background: var(--auth-field);
  color: var(--auth-ink);
  font: inherit;
  font-size: 16px; /* 16px evita el zoom automático de iOS */
  transition: border-color .15s, box-shadow .15s, background .15s;
  -webkit-appearance: none;
  appearance: none;
}

.field select {
  padding-right: 44px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20' fill='none' stroke='%236b7280' stroke-width='1.8'%3E%3Cpath d='m5 8 5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 16px center;
  background-size: 18px;
}

.field input::placeholder { color: #9ca3af; }

.field input:focus,
.field select:focus {
  border-color: var(--auth-navy);
  outline: none;
  background-color: #fff;
  box-shadow: 0 0 0 3px rgba(16, 39, 70, .12);
}

.field.has-error input,
.field.has-error select { border-color: var(--auth-red); background-color: #fff; }

.field__hint { margin: 6px 0 0; padding-left: 14px; color: var(--auth-muted); font-size: 12px; }
.field__error { margin: 6px 0 0; padding-left: 14px; color: var(--auth-red); font-size: 12.5px; font-weight: 600; }
.field__error:empty { display: none; }

.field__forgot { margin: 8px 0 0; text-align: right; }
.field__forgot a { font-size: 14px; text-decoration: none; }
.field__forgot a:hover { text-decoration: underline; }

.password { position: relative; }
.password input { padding-right: 56px; }
.password__toggle {
  position: absolute;
  top: 6px;
  right: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--auth-muted);
  cursor: pointer;
}
.password__toggle:hover { background: #e9e9e9; color: var(--auth-ink); }
.password__toggle svg { width: 20px; height: 20px; }

/* Botones */
.btn-auth {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 52px;
  margin: 0;
  padding: 14px 18px;
  border: 1px solid var(--auth-navy);
  border-radius: 26px;
  background: var(--auth-navy);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .06em;
  text-align: center;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background .15s, color .15s, border-color .15s;
}
.btn-auth:hover { background: var(--auth-navy-dark); border-color: var(--auth-navy-dark); color: #fff; }
.btn-auth[disabled] { opacity: .7; cursor: progress; }
.btn-auth--ghost { border-color: var(--auth-ink); background: #fff; color: var(--auth-ink); }
.btn-auth--ghost:hover { background: var(--auth-ink); border-color: var(--auth-ink); color: #fff; }

.auth__actions { display: grid; gap: 12px; margin-top: 26px; }

.auth__alert {
  margin: 0 0 18px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #fef3f2;
  color: var(--auth-red);
  font-size: 13.5px;
  font-weight: 600;
}
.auth__alert:empty { display: none; }

.auth__cart-note { margin: 4px 0 0; color: var(--auth-muted); font-size: 13px; text-align: center; }

.auth__badge {
  display: flex;
  gap: 10px;
  align-items: center;
  margin: 0 0 24px;
  padding: 12px 16px;
  border-radius: 14px;
  background: #ecfdf3;
  color: var(--auth-green);
  font-size: 13.5px;
  font-weight: 600;
}
.auth__badge svg { flex: 0 0 20px; width: 20px; height: 20px; }

.auth__promo {
  margin: 24px 0 0;
  padding-top: 20px;
  border-top: 1px solid #eee;
  color: var(--auth-muted);
  font-size: 13.5px;
  text-align: center;
}
.auth__promo a { font-weight: 700; }

.auth__switch { margin: 18px 0 0; color: var(--auth-muted); font-size: 14px; text-align: center; }
.auth__switch a { font-weight: 700; }

.auth__footer { margin: 20px 0 0; color: #9ca3af; font-size: 12px; text-align: center; }

:focus-visible { outline: 2px solid #4779b8; outline-offset: 2px; }

@media (max-width: 767px) {
  html, body { background: #fff; }
  .auth { justify-content: flex-start; padding: 12px 6px 24px; }
  .auth-card { padding: 14px; }
  .auth__logo { width: 160px; margin: 8px auto 28px; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
