/* ================================================
   MARKENTLAND SaaS — Auth (Login / Registro)
   ================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--color-text);
  min-height: 100vh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ── Layout split ── */
.auth-root {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* ── Panel izquierdo (branding Markentland) ── */
.auth-brand {
  position: relative;
  background: linear-gradient(155deg, var(--terra-800) 0%, var(--terra-600) 55%, var(--terra-400) 100%);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 52px 56px;
  overflow: hidden;
}

.auth-brand::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 60% 40% at 80% 20%, rgba(255,255,255,.06) 0%, transparent 70%),
    radial-gradient(ellipse 50% 60% at 10% 90%, rgba(0,0,0,.18) 0%, transparent 70%);
  pointer-events: none;
}

/* Patrón de puntos decorativo */
.auth-brand__pattern {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.12) 1px, transparent 1px);
  background-size: 28px 28px;
  pointer-events: none;
}

.auth-brand__top {
  position: relative;
  z-index: 1;
}

.auth-brand__logo {
  display: block;
  height: 36px;
  width: auto;
}

.auth-brand__body {
  position: relative;
  z-index: 1;
}

.auth-brand__title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 2.8vw, 2.6rem);
  font-weight: 700;
  color: #fff;
  line-height: 1.2;
  margin-bottom: 20px;
  letter-spacing: -.01em;
}

.auth-brand__title em {
  font-style: italic;
  color: var(--terra-200);
}

.auth-brand__desc {
  font-size: .95rem;
  color: rgba(255,255,255,.72);
  line-height: 1.65;
  max-width: 340px;
}

.auth-brand__pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 32px;
}

.auth-brand__pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: .78rem;
  font-weight: 500;
  color: rgba(255,255,255,.9);
  backdrop-filter: blur(4px);
}

.auth-brand__pill svg {
  flex-shrink: 0;
  opacity: .85;
}

.auth-brand__footer {
  position: relative;
  z-index: 1;
  font-size: .75rem;
  color: rgba(255,255,255,.45);
}

/* ── Panel derecho (formulario) ── */
.auth-form-side {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 52px 48px;
  background: #fff;
}

.auth-card {
  width: 100%;
  max-width: 380px;
}

/* Cabecera con logo de la tienda */
.auth-store {
  text-align: center;
  margin-bottom: 40px;
}

.auth-store__logo {
  width: 200px;
  height: 200px;
  object-fit: contain;
  border-radius: 50%;
  display: block;
  margin: 0 auto 16px;
}

.auth-store__name {
  font-family: var(--font-display);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--warm-900);
  letter-spacing: -.01em;
  margin-bottom: 0;
}

.auth-store__subtitle {
  font-size: .85rem;
  color: var(--color-text-muted);
}

.auth-store__reg-label {
  font-size: .82rem;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* Formulario */
.auth-form {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

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

.auth-field label {
  font-size: .82rem;
  font-weight: 600;
  color: var(--warm-700);
  letter-spacing: .02em;
  text-transform: uppercase;
}

.auth-field input {
  width: 100%;
  height: 48px;
  border: 1.5px solid var(--sand-200);
  border-radius: var(--r-sm);
  padding: 0 14px;
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--warm-900);
  background: #fff;
  transition: border-color .18s, box-shadow .18s;
  outline: none;
}

.auth-field input:focus {
  border-color: var(--terra-500);
  box-shadow: 0 0 0 3px rgba(200,75,17,.1);
}

.auth-field input::placeholder {
  color: #b8a99a;
}

/* Error inline */
.auth-field__error {
  font-size: .78rem;
  color: #c0392b;
  display: none;
}

.auth-field.has-error input {
  border-color: #c0392b;
}

.auth-field.has-error .auth-field__error {
  display: block;
}

/* Fila de opciones */
.auth-form__opts {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .82rem;
}

.auth-remember {
  display: flex;
  align-items: center;
  gap: 7px;
  cursor: pointer;
  color: var(--color-text-muted);
  user-select: none;
}

.auth-remember input[type="checkbox"] {
  accent-color: var(--terra-500);
  width: 15px;
  height: 15px;
  cursor: pointer;
}

.auth-forgot {
  color: var(--terra-600);
  font-weight: 500;
  text-decoration: none;
  transition: color .15s;
}

.auth-forgot:hover { color: var(--terra-500); }

/* Botón submit */
.auth-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 50px;
  border: none;
  border-radius: var(--r-sm);
  background: var(--terra-500);
  color: #fff;
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, transform .12s, box-shadow .18s;
  box-shadow: 0 4px 16px rgba(200,75,17,.28);
  margin-top: 4px;
}

.auth-submit:hover {
  background: var(--terra-600);
  box-shadow: 0 6px 20px rgba(200,75,17,.36);
  transform: translateY(-1px);
}

.auth-submit:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(200,75,17,.2);
}

.auth-submit:disabled {
  opacity: .65;
  cursor: not-allowed;
  transform: none;
}

.auth-submit svg {
  transition: transform .18s;
}

.auth-submit:hover svg { transform: translateX(3px); }

/* Alerta de error global */
.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: #fff2f0;
  border: 1px solid #ffd4cd;
  border-radius: var(--r-sm);
  padding: 12px 14px;
  font-size: .86rem;
  color: #7a2020;
  line-height: 1.4;
  animation: slideDown .2s ease;
}

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

.auth-alert svg { flex-shrink: 0; margin-top: 1px; color: #c0392b; }

/* Divider */
.auth-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--sand-200);
  font-size: .78rem;
  color: var(--color-text-muted);
}

.auth-divider::before,
.auth-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--sand-100);
}

/* Card ancha para registro */
.auth-card--wide {
  max-width: 480px;
}

/* Link a registro / login */
.auth-register-link {
  text-align: center;
  font-size: .84rem;
  color: var(--color-text-muted);
  margin-top: 22px;
}

.auth-register-link a {
  color: var(--terra-600);
  font-weight: 600;
  text-decoration: none;
  margin-left: 4px;
}

.auth-register-link a:hover { color: var(--terra-500); }

/* Flash de éxito en login */
.auth-alert--success {
  background: #EAF6EE;
  border-color: #B8DFC5;
  color: #1A5E35;
}

.auth-alert--success svg { color: #1A5E35; }

/* 2 columnas en registro */
.auth-2col {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

@media (max-width: 480px) {
  .auth-2col { grid-template-columns: 1fr; }
}

/* Footer powered-by */
.auth-powered {
  margin-top: 40px;
  text-align: center;
  font-size: .75rem;
  color: #b8a99a;
}

.auth-powered a {
  color: var(--terra-600);
  font-weight: 600;
  text-decoration: none;
}

.auth-powered a:hover { color: var(--terra-500); }

/* ── Responsive ── */
@media (max-width: 840px) {
  .auth-root {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    display: none;
  }

  .auth-form-side {
    padding: 40px 24px;
    min-height: 100vh;
  }
}

@media (max-width: 400px) {
  .auth-form-side { padding: 32px 16px; }
}
