/* Páginas de acceso (login y registro), tema agua: panel de marca azul claro (foto, olas y burbujas)
   a la izquierda y formulario a la derecha. Mismos colores que smartdrop.css. */
* { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  /* Colores tomados de tokens.css (los mismos de toda la web). */
  --auth-font-body: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --auth-font-heading: 'Montserrat', 'Inter', system-ui, sans-serif;
  --auth-bg: var(--c-surface);
  --auth-surface: var(--c-surface-2);
  --auth-text: var(--c-ink);
  --auth-text-2: var(--c-ink-2);
  --auth-text-3: var(--c-ink-3);
  --auth-border: var(--c-line);
  --auth-border-hover: var(--c-line-strong);
  --auth-brand: var(--c-anil);
  --auth-brand-hover: var(--c-anil-strong);
  --auth-brand-ring: rgba(3, 105, 161, 0.18);
  --auth-boton: linear-gradient(135deg, #0377B5 0%, #0369A1 50%, #075985 100%);
  --auth-danger: var(--c-bad);
  --auth-danger-bg: var(--c-bad-bg);
  --auth-danger-border: #fecdca;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; }
body.sd-auth {
  font-family: var(--auth-font-body);
  color: var(--auth-text);
  background: var(--auth-bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

.auth-shell {
  display: grid;
  grid-template-columns: minmax(420px, 46%) 1fr;
  min-height: 100vh;
}

/* ── Panel de marca ── */
.auth-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 48px;
  padding: 48px 56px;
  color: var(--auth-text);
  background:
    radial-gradient(700px 420px at 100% 0%, rgba(255, 255, 255, 0.85), transparent 60%),
    linear-gradient(160deg, #EAF7FE 0%, #D6EEFA 48%, #C2E6F6 100%);
}

/* Foto del agua al pie del panel, fundida con el degradado */
.auth-brand-foto {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 34%;
  object-fit: cover;
  object-position: 75% 55%;
  opacity: .9;
  pointer-events: none;
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent 95%);
  mask-image: linear-gradient(to top, #000 35%, transparent 95%);
}

/* Burbujas que suben */
.auth-burbuja {
  position: absolute;
  bottom: -20px;
  left: var(--x, 50%);
  width: var(--s, 10px);
  height: var(--s, 10px);
  border: 1.5px solid rgba(255, 255, 255, .85);
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, rgba(255, 255, 255, .9), transparent 60%);
  opacity: 0;
  pointer-events: none;
  animation: auth-subir var(--d, 10s) cubic-bezier(.2, .7, .2, 1) var(--t, 0s) infinite;
}

@keyframes auth-subir {
  0% { opacity: 0; transform: translate(0, 0) scale(.6); }
  15% { opacity: 1; }
  85% { opacity: .8; }
  100% { opacity: 0; transform: translate(-6px, -420px) scale(1.1); }
}
.auth-brand-waves {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 220px;
  pointer-events: none;
}
.auth-brand > *:not(.auth-brand-waves):not(.auth-brand-foto):not(.auth-burbuja) { position: relative; z-index: 1; }

.auth-brand-waves path { animation: auth-oleaje 12s linear infinite; }
.auth-brand-waves path + path { animation-duration: 18s; animation-direction: reverse; }

@keyframes auth-oleaje {
  0%, 100% { transform: translateX(0); }
  50% { transform: translateX(-40px); }
}

.auth-logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--auth-text);
  text-decoration: none;
  font-family: var(--auth-font-heading);
  font-weight: 700;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
}
.auth-logo svg { width: 34px; height: 34px; flex: none; }

.auth-brand-copy { max-width: 470px; }
.auth-brand-copy h2 {
  font-family: var(--auth-font-heading);
  font-size: clamp(1.75rem, 2.4vw, 2.3rem);
  line-height: 1.18;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}
.auth-brand-copy > p {
  color: var(--auth-text-2);
  font-size: 1rem;
  line-height: 1.6;
}
.auth-features {
  list-style: none;
  margin-top: 36px;
  display: grid;
  gap: 18px;
}
.auth-features li {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}
.auth-features .feature-icon {
  flex: none;
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.7);
  border: 1px solid rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 18px -12px rgba(3, 105, 161, .5);
  color: var(--auth-brand);
  font-size: 1.1875rem;
}
.auth-features strong {
  display: block;
  font-weight: 600;
  font-size: 0.95rem;
  margin-bottom: 2px;
}
.auth-features span {
  color: var(--auth-text-2);
  font-size: 0.875rem;
  line-height: 1.5;
}
.auth-brand-foot {
  color: var(--auth-text-2);
  font-size: 0.8rem;
}

/* ── Formulario ── */
.auth-main {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  padding: 32px 24px;
}
.auth-main-top { display: none; }
.auth-form-area {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 0;
}
.auth-form-box { width: 100%; max-width: 400px; }
.auth-form-box.is-wide { max-width: 440px; }

.auth-form-box h1 {
  font-family: var(--auth-font-heading);
  font-size: 1.75rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 8px;
}
.auth-lead {
  color: var(--auth-text-2);
  font-size: 0.95rem;
  line-height: 1.5;
  margin-bottom: 28px;
}

.auth-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 14px;
  margin-bottom: 20px;
  border-radius: 10px;
  border: 1px solid var(--auth-danger-border);
  background: var(--auth-danger-bg);
  color: var(--auth-danger);
  font-size: 0.875rem;
  line-height: 1.45;
}
.auth-alert i { font-size: 1.125rem; line-height: 1.2; }
.auth-alert ul { list-style: none; }

.auth-form { display: grid; gap: 18px; }
.auth-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.field label {
  display: block;
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--auth-text);
  margin-bottom: 7px;
}
.field-control { position: relative; }
.field-control > svg {
  position: absolute;
  left: 13px; top: 50%;
  width: 18px; height: 18px;
  transform: translateY(-50%);
  color: var(--auth-text-3);
  pointer-events: none;
}
.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid var(--auth-border);
  border-radius: 10px;
  background: #fff;
  color: var(--auth-text);
  font: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
}
.field-control > svg ~ input { padding-left: 40px; }
.field-control.has-toggle input { padding-right: 46px; }
.field input::placeholder { color: var(--auth-text-3); }
.field input:hover { border-color: var(--auth-border-hover); }
.field input:focus {
  outline: none;
  border-color: var(--auth-brand);
  box-shadow: 0 0 0 4px var(--auth-brand-ring);
}
.field.has-error input { border-color: var(--auth-danger); }
.field.has-error input:focus { box-shadow: 0 0 0 4px rgba(180, 35, 24, 0.14); }
.field-error {
  list-style: none;
  margin-top: 6px;
  color: var(--auth-danger);
  font-size: 0.8125rem;
}

.toggle-password {
  position: absolute;
  right: 4px; top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 38px; height: 38px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--auth-text-3);
  cursor: pointer;
}
.toggle-password:hover { color: var(--auth-text); background: var(--auth-surface); }
.toggle-password:focus-visible { outline: 2px solid var(--auth-brand); outline-offset: 1px; }
.toggle-password svg { width: 19px; height: 19px; }
.toggle-password .icon-hide { display: none; }
.toggle-password[aria-pressed="true"] .icon-show { display: none; }
.toggle-password[aria-pressed="true"] .icon-hide { display: block; }

.auth-submit {
  position: relative;
  width: 100%;
  height: 48px;
  margin-top: 6px;
  border: 0;
  border-radius: 10px;
  background: var(--auth-brand) var(--auth-boton);
  color: #fff;
  font: inherit;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(23, 20, 43, 0.12);
  transition: background-color 0.15s, box-shadow 0.15s;
}
.auth-submit:hover { background: var(--auth-brand-hover); }
.auth-submit { box-shadow: 0 10px 22px -14px rgba(3, 105, 161, .9); }
.auth-submit:focus-visible { outline: none; box-shadow: 0 0 0 4px var(--auth-brand-ring); }
.auth-submit[disabled] { cursor: progress; opacity: 0.85; }
.auth-submit .spinner {
  display: none;
  width: 18px; height: 18px;
  margin-right: 8px;
  vertical-align: -3px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: auth-spin 0.7s linear infinite;
}
.auth-submit.is-loading .spinner { display: inline-block; }
@keyframes auth-spin { to { transform: rotate(360deg); } }

.auth-switch {
  margin-top: 28px;
  text-align: center;
  color: var(--auth-text-2);
  font-size: 0.9rem;
}
.auth-switch a,
.auth-link {
  color: var(--auth-brand);
  font-weight: 600;
  text-decoration: none;
}
.auth-switch a:hover,
.auth-link:hover { text-decoration: underline; }

.auth-secure {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 18px;
  color: var(--auth-text-3);
  font-size: 0.8rem;
}
.auth-secure i { font-size: .9375rem; }

.auth-legal {
  text-align: center;
  color: var(--auth-text-3);
  font-size: 0.8rem;
}

/* ── Responsive ── */
@media (max-width: 960px) {
  .auth-shell { grid-template-columns: 1fr; }
  .auth-brand { display: none; }
  .auth-main { padding: 20px 16px 24px; }
  .auth-main-top {
    display: flex;
    justify-content: center;
    padding-top: 8px;
  }
  .auth-main-top .auth-logo { color: var(--auth-text); }
  .auth-form-area { align-items: flex-start; padding-top: 16px; }
}
@media (max-width: 420px) {
  .auth-row { grid-template-columns: 1fr; }
  .auth-form-box h1 { font-size: 1.5rem; }
}
@media (prefers-reduced-motion: reduce) {
  .auth-submit .spinner { animation-duration: 2s; }
  .auth-burbuja { display: none; }
  .auth-brand-waves path { animation: none; }
}
