/* ═══════════════════════════════════════════
   Tema v2 — Acceso (Login, ResetPassword)
   Prefijo: v2au-  · Sin el header de la tienda
═══════════════════════════════════════════ */

body.theme-v2.v2au-page {
  min-height: 100vh;
  min-height: 100dvh;
  padding-top: 0;
  background: #fff;
}

.v2au,
.v2au *,
.v2au-modal,
.v2au-modal * {
  box-sizing: border-box;
}

.v2au {
  display: grid;
  grid-template-rows: auto 1fr;
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--v2-font);
  color: var(--v2-ink);
}

/* ── Panel de la marca ────────────────────── */
/* Móvil: bloque compacto arriba (logo + 3 productos). PC: columna izquierda completa. */

.v2au-brand {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin: 12px 12px 0;
  padding: 16px 16px 18px;
  border-radius: 24px;
  background: #f5eef1;
  background: color-mix(in srgb, var(--v2-accent) 16%, #ffffff);
}

.v2au-brand-back {
  color: var(--v2-ink);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
  opacity: 0.75;
}

.v2au-brand-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--v2-ink);
  font-size: 16px;
  font-weight: 700;
  text-decoration: none;
}

.v2au-brand-logo img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  background: #fff;
  object-fit: contain;
}

.v2au-collage {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
  gap: 8px;
  height: 104px;
}

.v2au-collage span {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
}

.v2au-collage img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 12%;
  object-fit: contain;
}

.v2au-brand-slogan {
  display: none;
}

/* Móvil: solo el formulario (el panel de la marca es para PC) */
@media (max-width: 1023px) {
  .v2au-brand {
    display: none;
  }

  .v2au {
    grid-template-rows: minmax(0, 1fr);
  }

  .v2au-panel {
    padding: 20px 24px calc(28px + env(safe-area-inset-bottom));
  }

  /* El formulario empieza más abajo, a la misma altura en las dos pestañas
     (así "Iniciar sesión / Crear cuenta" se siente como un interruptor que no se mueve) */
  .v2au-box {
    gap: 18px;
    margin-top: max(48px, 10vh) !important;
  }

  /* El subtítulo reserva 2 líneas para que las pestañas no salten al cambiar de vista */
  .v2au-sub {
    min-height: 3em;
  }

  .v2au-form {
    gap: 16px;
  }
}

/* Autocompletado del navegador: sin el fondo azul */
.v2au-field input:-webkit-autofill,
.v2au-field input:-webkit-autofill:hover,
.v2au-field input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px #fff inset;
  -webkit-text-fill-color: var(--v2-ink);
  caret-color: var(--v2-ink);
  transition: background-color 9999s ease 0s;
}

/* ── Panel del formulario ─────────────────── */

.v2au-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 16px 20px calc(24px + env(safe-area-inset-bottom));
}

.v2au-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 40px;
}

.v2au-back {
  color: var(--v2-muted);
  font-size: 13px;
  font-weight: 500;
  text-decoration: none;
}

.v2au-back:hover {
  color: var(--v2-ink);
}

.v2au-mobile-logo {
  display: inline-flex;
  align-items: center;
  color: var(--v2-ink);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.v2au-mobile-logo img {
  width: 40px;
  height: 40px;
  border-radius: 11px;
  object-fit: contain;
}

.v2au-box {
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: 100%;
  max-width: 400px;
  margin: 8px auto 0;
}

.v2au-page--single .v2au-box {
  margin-top: 32px;
}

/* ResetPassword: no lleva panel de la marca */
.v2au-page--single .v2au {
  grid-template-rows: minmax(0, 1fr);
}

.v2au-title {
  margin: 0;
  font-size: 28px;
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.v2au-sub {
  margin: -8px 0 4px;
  color: var(--v2-muted);
  font-size: 14px;
  line-height: 1.5;
}

/* Pestañas */
.v2au-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  padding: 4px;
  border-radius: 999px;
  background: var(--v2-soft);
}

.v2au-tabs[hidden] {
  display: none;
}

.v2au-tab {
  height: 40px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--v2-muted);
  font-family: var(--v2-font);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.2s ease,
    color 0.2s ease;
}

.v2au-tab.is-active {
  background: #fff;
  color: var(--v2-ink);
  box-shadow: 0 1px 4px rgba(20, 24, 35, 0.1);
}

/* Mensajes */
.v2au-msg {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--v2-soft);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.5;
}

.v2au-msg[hidden] {
  display: none;
}

.v2au-msg.is-ok {
  background: #ecf8f1;
  color: #1d7a4a;
}

.v2au-msg.is-error {
  background: #fdf0f2;
  color: #c0304f;
}

.v2au-msg.is-warning {
  background: #fff4e0;
  color: #8a5300;
}

.v2au-msg a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
}

/* Formularios */
.v2au-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.v2au-form[hidden] {
  display: none;
}

.v2au-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.v2au-field > span:first-child {
  font-size: 13px;
  font-weight: 600;
}

.v2au-field small {
  color: var(--v2-muted);
  font-size: 12px;
}

.v2au-field input {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  border: 1px solid #d6d6db;
  border-radius: 12px;
  background: #fff;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 15px;
  outline: none;
  transition: border-color 0.2s ease;
}

.v2au-field input::placeholder {
  color: #a3a3aa;
}

.v2au-field input:focus {
  border-color: var(--v2-ink);
}

.v2au-pass {
  position: relative;
  display: block;
}

.v2au-pass input {
  padding-right: 48px;
}

.v2au-eye {
  position: absolute;
  top: 50%;
  right: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  border: 0;
  border-radius: 10px;
  background: none;
  color: var(--v2-muted);
  cursor: pointer;
  transform: translateY(-50%);
}

.v2au-eye.is-on {
  color: var(--v2-ink);
}

.v2au-submit {
  width: 100%;
  height: 50px;
  margin-top: 4px;
  font-size: 14px;
  font-weight: 600;
}

.v2au-submit:disabled {
  opacity: 0.6;
  cursor: progress;
}

.v2au-link {
  padding: 0;
  border: 0;
  background: none;
  color: var(--v2-ink);
  font-family: var(--v2-font);
  font-size: 13px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(29, 29, 31, 0.3);
  text-underline-offset: 3px;
  cursor: pointer;
}

.v2au-forgot {
  align-self: flex-end;
  margin-top: -4px;
}

.v2au-center {
  align-self: center;
}

.v2au-perk {
  margin: 0;
  padding: 12px 14px;
  border: 1px dashed color-mix(in srgb, var(--v2-accent) 55%, #ffffff);
  border-radius: 14px;
  background: color-mix(in srgb, var(--v2-accent) 8%, #ffffff);
  font-size: 13px;
  line-height: 1.5;
}

.v2au-legal {
  margin: 0;
  color: var(--v2-muted);
  font-size: 12px;
  line-height: 1.5;
  text-align: center;
}

.v2au-legal .v2au-link {
  font-size: 12px;
  font-weight: 500;
}

.v2au-foot {
  margin: auto 0 0;
  padding-top: 32px;
  color: var(--v2-muted);
  font-size: 12px;
  text-align: center;
}

.v2au-foot .v2au-link {
  color: var(--v2-muted);
  font-size: 12px;
  font-weight: 500;
}

/* ── Modales legales ──────────────────────── */

.v2au-modal {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  background: rgba(20, 20, 24, 0.45);
  font-family: var(--v2-font);
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.2s ease,
    visibility 0.2s ease;
}

.v2au-modal.is-open {
  opacity: 1;
  visibility: visible;
}

.v2au-modal-box {
  position: relative;
  width: 100%;
  max-height: 85vh;
  padding: 24px 20px calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
  border-radius: 22px 22px 0 0;
  background: #fff;
  color: var(--v2-ink);
}

.v2au-modal-box h2 {
  margin: 0 40px 12px 0;
  font-size: 19px;
  font-weight: 600;
}

.v2au-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: var(--v2-soft);
  color: var(--v2-ink);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
}

.v2au-legal-text h3 {
  margin: 16px 0 4px;
  font-size: 14px;
  font-weight: 600;
}

.v2au-legal-text p {
  margin: 0;
  color: #4a4a50;
  font-size: 13px;
  line-height: 1.6;
}

/* ── Breakpoints ─────────────────────────── */

@media (min-width: 700px) {
  .v2au-modal {
    align-items: center;
    padding: 24px;
  }

  .v2au-modal-box {
    max-width: 560px;
    padding: 28px;
    border-radius: 22px;
  }
}

@media (min-width: 1024px) {
  .v2au {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: minmax(0, 1fr);
  }

  .v2au-page--single .v2au {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2au-brand {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 32px;
    margin: 16px 0 16px 16px;
    padding: 36px;
    overflow: hidden;
    border-radius: 28px;
    background: #f5eef1;
    background: color-mix(in srgb, var(--v2-accent) 16%, #ffffff);
  }

  .v2au-brand-logo {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    color: var(--v2-ink);
    font-size: 18px;
    font-weight: 700;
    text-decoration: none;
  }

  .v2au-brand-logo img {
    width: 48px;
    height: 48px;
    border-radius: 13px;
    background: #fff;
    object-fit: contain;
  }

  /* 1 grande + 2 chicas, como las tarjetas de categoría */
  .v2au-brand-back {
    display: none;
  }

  .v2au-page:not(.v2au-page--single) .v2au-top {
    display: flex;
  }

  .v2au-collage {
    display: grid;
    grid-auto-flow: row;
    height: auto;
    grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
    grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
    gap: 12px;
    width: 100%;
    max-width: 520px;
    aspect-ratio: 5 / 4;
    margin: 0 auto;
  }

  .v2au-collage span {
    position: relative;
    overflow: hidden;
    border-radius: 20px;
    background: #fff;
  }

  .v2au-collage span:first-child {
    grid-row: span 2;
  }

  .v2au-collage--1 {
    grid-template-columns: minmax(0, 1fr);
  }

  .v2au-collage--2 {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }

  .v2au-collage img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    padding: 12%;
    object-fit: contain;
  }

  .v2au-brand-slogan {
    display: block;
    max-width: 440px;
    margin: 0;
    font-size: 26px;
    font-weight: 600;
    line-height: 1.2;
    letter-spacing: -0.01em;
  }

  .v2au-panel {
    padding: 28px 48px;
  }

  .v2au-mobile-logo {
    display: none;
  }

  .v2au-mobile-logo--always {
    display: inline-flex;
  }

  .v2au-box {
    margin-top: auto;
    margin-bottom: auto;
  }

  .v2au-foot {
    margin-top: 0;
  }

  .v2au-title {
    font-size: 32px;
  }
}
