/*
 * user_login — CSS mínimo (sin frameworks).
 *
 * Layout: header (color de tienda + logo_store) · form centrado · política abajo.
 * Prefijo .ul-* · radius máximo 4px · fondo blanco · sin frame / panel lateral.
 *
 * Tokens de tienda (inline en el layout):
 *   --ul-accent / --ul-accent-text  → store.frontcolor
 *   --ul-header-bg / --ul-header-ink → store.header_color
 * Logo = store.logo_store (fallback texto con contraste).
 *
 * Secciones: tokens → reset → page → type → form → otp → flash → loading.
 */

:root {
  --ul-bg: #ffffff;
  --ul-surface: #ffffff;
  --ul-ink: #1a1a1a;
  --ul-muted: #6b6b6b;
  --ul-line: #d9d9d9;
  --ul-accent: #4a32b3;
  --ul-accent-text: #ffffff;
  --ul-danger: #b42318;
  --ul-ok: #067647;
  --ul-warn-bg: #fff;
  --ul-warn-ink: #067647;
  --ul-radius: 4px;
  --ul-pad: 1.25rem;
  --ul-gap: 1rem;
  --ul-form-max: 400px;
  --ul-font: Roboto, sans-serif;
  --ul-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --ul-header-bg: #ffffff;
  --ul-header-ink: #1a1a1a;
}

/* --- reset --- */
*, *::before, *::after { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font: 15px/1.45 var(--ul-font);
  color: var(--ul-ink);
  background: var(--ul-bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--ul-muted); }

button, input, select { font: inherit; }

/* --- page shell: logo top · form centered · privacy bottom --- */
.ul-page {
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--ul-bg);
}

.ul-header {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem 1.25rem;
  background: var(--ul-header-bg);
  color: var(--ul-header-ink);
  border-bottom: 1px solid #d9d9d9;
}

.ul-brand {
  display: flex;
  justify-content: center;
}

.ul-brand a { display: inline-flex; }

.ul-brand img {
  width: auto;
  max-width: min(180px, 70vw);
  height: 56px;
  -o-object-fit: contain;
     object-fit: contain;
}

.ul-brand-name {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--ul-header-ink);
  text-decoration: none;
}

.ul-main {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  padding: 40px 30px 40px 30px;
}

.ul-form-inner {
  width: min(100%, var(--ul-form-max));
  margin-block: auto;
  margin-inline: auto;
}

.ul-form-inner--wide {
  width: min(100%, 480px);
}

.ul-footer {
  flex: 0 0 auto;
  display: flex;
  justify-content: center;
  padding: 1rem 1.25rem 1.75rem;
}

.ul-footer-link {
  color: var(--ul-muted);
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.ul-footer-link:hover { text-decoration: underline; }

/* --- type --- */
.ul-title-wrapper {
  margin-bottom: 40px;
}
.ul-title {
  margin: 0 0 3px 0;
  font-size: 17px;
  font-weight: 600;
  line-height: 120%;
  text-align: center;
  text-transform: uppercase;
  color: var(--ul-ink);
}
.ul-lead {
  margin: 0;
  text-align: center;
  color: var(--ul-muted);
  font-size: 0.875rem;
}
.ul-hint {
  margin-top: 0;
  margin-bottom: 0;
  color: var(--ul-muted);
  font-size: 11px;
}

.ul-section {
  margin: 20px 0 0 0;
  font-size: 15px;
  font-weight: 650;
  line-height: 100%;
  text-align: center;
  text-transform: uppercase;
}

.ul-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.5rem 1rem;
  margin-top: 0.85rem;
}

.ul-nav--center { justify-content: center; }

.ul-link {
  color: var(--ul-muted);
  font-weight: 600;
  font-size: 0.875rem;
  text-decoration: none;
  text-underline-offset: 0.18em;
}

.ul-link:hover { text-decoration: underline; }

.ul-legal {
  margin: 1.25rem 0 0;
  color: var(--ul-muted);
  font-size: 0.75rem;
  text-align: left;
  line-height: 1.5;
}

.ul-legal a { color: var(--ul-muted); font-weight: 600; text-decoration: none; }

.ul-legal a:hover { text-decoration: underline; }

.ul-notice {
  margin: 0 0 1rem;
  padding: 0.7rem 0.8rem;
  background: var(--ul-warn-bg);
  color: var(--ul-warn-ink);
  border: 1px solid var(--ul-line);
  border-radius: var(--ul-radius);
  font-size: 0.875rem;
  text-align: center;
}

.ul-otp-block .ul-notice {
  text-align: center;
}

.ul-humanizer {
  display: grid;
  gap: 0.75rem;
  padding: 0.9rem 0.95rem 1rem;
  background: var(--ul-warn-bg);
  color: var(--ul-warn-ink);
  border: 1px solid #f0d7a8;
  border-radius: var(--ul-radius);
}

.ul-humanizer-q {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--ul-warn-ink);
}

.ul-humanizer .ul-field label { color: var(--ul-warn-ink); }

.ul-humanizer .ul-hint {
  margin: 0;
  color: #9a6700;
}

.ul-cross {
  margin: 0 0 1rem;
  text-align: left;
}

.ul-cross p { margin: 0.5rem 0 0; color: var(--ul-ok); font-size: 0.875rem; }

.ul-cross img { max-height: 36px; }

/* --- form --- */
.ul-form { display: grid; gap: var(--ul-gap); }

.ul-grid {
  display: grid;
  gap: var(--ul-gap);
  margin-bottom: 0;
}

@media (min-width: 560px) {
  .ul-grid--2 { grid-template-columns: 1fr 1fr; }
}

.ul-field { display: grid; gap: 0.35rem; }

.ul-field label {
  font-size: 13px;
  font-weight: 500;
  color: #444;
  line-height: 100%;
  margin-bottom: 0;
}

.ul-input,
.ul-select {
  width: 100%;
  padding: 10px;
  border: 1px solid var(--ul-line);
  border-radius: var(--ul-radius);
  background: #fff;
  color: var(--ul-ink);
}

.ul-select {
  padding-right: 2.25rem;
  -webkit-appearance: none;
     -moz-appearance: none;
          appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236b6b6b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  background-size: 1rem;
}

.ul-input::-moz-placeholder { color: #a3a3a3; }

.ul-input::placeholder { color: #a3a3a3; }

.ul-input:focus,
.ul-select:focus,
.ul-otp-digit:focus {
  outline: none;
  border-color: var(--ul-accent);
  box-shadow: 0 0 0 1px var(--ul-accent);
}

.ul-password { position: relative; }

.ul-password .ul-input {
  padding-right: 2.75rem;
}

.ul-eye {
  position: absolute;
  top: 50%;
  right: 0.35rem;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ul-muted);
  cursor: pointer;
  border-radius: var(--ul-radius);
}

.ul-eye:hover { color: var(--ul-ink); }

.ul-eye-icon {
  width: 1.15rem;
  height: 1.15rem;
  display: block;
  flex-shrink: 0;
}

.ul-eye-icon--open { display: none; }

.ul-eye.is-revealed .ul-eye-icon--closed { display: none; }

.ul-eye.is-revealed .ul-eye-icon--open { display: block; }

.ul-password-block {
  display: grid;
  gap: 0.35rem;
}

.ul-check {
  display: flex;
  align-items: flex-start;
  gap: 0.65rem;
  margin: 0;
  padding: 0.9rem 1rem;
  font-size: 0.875rem;
  line-height: 1.4;
  background: #f3f3f3;
  border: 1px solid var(--ul-line);
  border-radius: var(--ul-radius);
  cursor: pointer;
}

.ul-check input { margin-top: 0.15rem; flex-shrink: 0; accent-color: var(--ul-accent); }

.ul-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  box-sizing: border-box;
  line-height: 100%;
  padding: 18px 16px 17px 16px;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  border: 0;
  border-radius: var(--ul-radius);
  background: var(--ul-accent);
  color: var(--ul-accent-text);
  font-weight: 700;
  cursor: pointer;
}

.ul-btn:hover { filter: brightness(1.05); }

.ul-btn--ghost {
  background: transparent;
  color: var(--ul-muted);
  border: 1px solid var(--ul-line);
  filter: none;
}

.ul-btn--ghost:hover {
  filter: none;
  background: #f7f7f7;
  color: var(--ul-ink);
  text-decoration: none;
}

.ul-actions {
  display: grid;
  gap: 0.45rem;
}

.ul-btn:disabled,
.ul-btn[aria-disabled="true"] {
  opacity: 0.45;
  cursor: not-allowed;
}

.ul-btn[disabled] { pointer-events: none; }

.formError {
  color: var(--ul-danger);
  font-size: 0.78rem;
  line-height: 100%;
}

.ul-errors {
  padding: 15px;
  border: 1px solid var(--ul-line);
  background: #fff;
  border-radius: var(--ul-radius);
  color: var(--ul-danger);
  font-size: 0.875rem;
}

.ul-errors strong { display: block; margin-bottom: 0.3rem; }

.ul-errors ul { margin: 0; padding-left: 1.1rem; }

/* --- otp --- */
.ul-otp-block {
  text-align: center;
}

.ul-field--otp {
  justify-items: center;
  text-align: center;
}

.ul-otp {
  display: flex;
  justify-content: center;
  gap: 0.4rem;
}

.ul-otp-digit {
  width: 2.5rem;
  height: 2.85rem;
  text-align: center;
  font: 700 1.15rem/1 var(--ul-mono);
  border: 1px solid var(--ul-line);
  border-radius: var(--ul-radius);
  background: #fff;
}

@media (max-width: 380px) {
  .ul-otp-digit { width: 2.15rem; height: 2.6rem; font-size: 1rem; }
}

/* --- flash --- */
.ul-flash {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  padding: 0.65rem 0.75rem;
  border: 1px solid var(--ul-line);
  border-radius: var(--ul-radius);
  background: #fff;
  font-size: 0.875rem;
}

.ul-flash--notice,
.ul-flash--success { color: var(--ul-ok); border-color: var(--ul-ok); }

.ul-flash--alert,
.ul-flash--error { color: var(--ul-danger); border-color: var(--ul-danger); }

.ul-flash button {
  border: 0;
  background: transparent;
  color: inherit;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
}

/* --- progress / loading (gris fijo, sin accent de tienda) --- */
/* Barra nativa de Turbo Drive (por defecto es azul) */
.turbo-progress-bar {
  background: #9a9a9a !important;
  height: 3px;
  z-index: 2147483646 !important;
}

.ul-loading {
  position: fixed;
  inset: 0;
  z-index: 2147483645;
  display: grid;
  place-items: center;
  background: rgb(255 255 255 / 75%);
}

.ul-loading[hidden] { display: none; }

.ul-loading-spin {
  color: #9a9a9a;
}

.ul-loading-ring {
  display: block;
  width: 2.75rem;
  height: 2.75rem;
  border: 3px solid #d4d4d4;
  border-top-color: #9a9a9a;
  border-radius: 50%;
  animation: ul-spin 0.7s linear infinite;
}

.ul-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@keyframes ul-spin {
  to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
  .ul-loading-ring { animation: none; }
}
