/* ─────────────────────────────────────────────────────────────
   Auth Pages — Design System compliant
   Shared layout for simple single-card auth pages:
   password reset flow, activation messages.
───────────────────────────────────────────────────────────── */
@import url("design-system/ds_tokens.31e0c782ea01.css");
@import url("design-system/ds_components.e51de7707733.css");

/* ── Reset mínimo ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
}

/* ── Shell ─────────────────────────────────────────────────── */
body {
  font-family: var(--mm-font);
  background: var(--mm-bg-app);
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--mm-s-4);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: var(--mm-text-primary);
}

/* ── Auth card ─────────────────────────────────────────────── */
.auth-card {
  width: 100%;
  max-width: 480px;
  background: var(--mm-surface);
  border-radius: var(--mm-r-2xl);
  box-shadow: var(--mm-shadow-xl);
  padding: var(--mm-s-7) var(--mm-s-6);
  display: flex;
  flex-direction: column;
}

/* ── Logo ──────────────────────────────────────────────────── */
.auth-logo {
  height: 56px;
  width: auto;
  max-width: 160px;
  object-fit: contain;
  align-self: flex-start;
  flex-shrink: 0;
  margin-bottom: var(--mm-s-5);
}

/* ── Success icon (done/complete pages) ────────────────────── */
.auth-success-icon {
  width: 56px;
  height: 56px;
  background: var(--mm-success-50);
  border: 2px solid var(--mm-success-100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--mm-s-4);
  color: var(--mm-success-600);
}

/* ── Typography ────────────────────────────────────────────── */
.auth-title {
  font-size: var(--mm-text-2xl);
  font-weight: 700;
  color: var(--mm-text-primary);
  letter-spacing: -0.02em;
  margin-bottom: var(--mm-s-1);
}

.auth-subtitle {
  font-size: var(--mm-text-sm);
  color: var(--mm-text-secondary);
  margin-bottom: var(--mm-s-5);
  line-height: 1.65;
}

/* ── Form ──────────────────────────────────────────────────── */
.auth-form { display: flex; flex-direction: column; gap: var(--mm-s-4); }

/* Label override — DS default is 11px; auth pages use 15px */
.auth-form .mm-field__label {
  font-size: var(--mm-text-md);
  font-weight: 500;
  color: var(--mm-text-secondary);
  margin-bottom: var(--mm-s-2);
}

/* Inputs */
.auth-form .mm-input {
  height: var(--mm-control-height-lg);
  font-size: var(--mm-text-base);
  border-radius: var(--mm-r-lg);
  background: var(--mm-surface-soft);
  padding: 0 var(--mm-s-4);
}
.auth-form .mm-input:focus { background: var(--mm-surface); }

/* Password input with trailing eye */
.auth-form .mm-input-wrap--trail .mm-input {
  padding-right: 44px;
  padding-left: var(--mm-s-4);
}

/* Eye button */
.auth-eye-btn {
  position: absolute;
  right: var(--mm-s-3);
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--mm-s-1);
  color: var(--mm-text-muted);
  display: flex;
  align-items: center;
  border-radius: var(--mm-r-sm);
  transition: color var(--mm-t-fast) var(--mm-ease);
  -webkit-tap-highlight-color: transparent;
}
.auth-eye-btn:hover { color: var(--mm-text-secondary); }
.auth-eye-btn:focus-visible {
  outline: 2px solid var(--mm-brand-500);
  outline-offset: 2px;
}

/* ── Password rules ────────────────────────────────────────── */
.auth-pw-rules {
  display: flex;
  flex-direction: column;
  gap: var(--mm-s-1);
  background: var(--mm-surface-soft);
  border: 1px solid var(--mm-border);
  border-radius: var(--mm-r-md);
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding: 0 var(--mm-s-4);
  margin-top: 0;
  transition: max-height 0.3s ease, opacity 0.3s ease, margin-top 0.2s ease, padding 0.3s ease;
}
.auth-pw-rules.visible {
  max-height: 200px;
  opacity: 1;
  margin-top: var(--mm-s-2);
  padding: var(--mm-s-3) var(--mm-s-4);
}

.auth-pw-rule {
  display: flex;
  align-items: center;
  gap: var(--mm-s-2);
  font-size: var(--mm-text-sm);
  color: var(--mm-text-muted);
  transition: color 0.2s;
}
.auth-pw-rule.valid   { color: var(--mm-success-600); }
.auth-pw-rule.invalid { color: var(--mm-danger-600); }

/* ── Error alert ───────────────────────────────────────────── */
.auth-error {
  display: none;
  align-items: flex-start;
  gap: var(--mm-s-2);
  padding: var(--mm-s-3) var(--mm-s-4);
  background: var(--mm-danger-50);
  border: 1px solid var(--mm-danger-100);
  border-radius: var(--mm-r-md);
  font-size: var(--mm-text-sm);
  color: var(--mm-danger-600);
  font-weight: 500;
  line-height: 1.45;
}
.auth-error.is-visible { display: flex; }

/* ── Submit button ─────────────────────────────────────────── */
.auth-submit {
  height: var(--mm-control-height-lg) !important;
  font-size: var(--mm-text-md) !important;
  border-radius: var(--mm-r-lg) !important;
  font-weight: 600 !important;
  letter-spacing: 0.01em;
}

/* ── Back / secondary links ────────────────────────────────── */
.auth-back-link {
  display: block;
  margin-top: var(--mm-s-4);
  font-size: var(--mm-text-sm);
  color: var(--mm-text-secondary);
  text-decoration: none;
  font-weight: 500;
  text-align: center;
  transition: color var(--mm-t-fast);
}
.auth-back-link:hover { color: var(--mm-brand-600); }

/* ── Footer ────────────────────────────────────────────────── */
.auth-footer {
  margin-top: var(--mm-s-5);
  padding-top: var(--mm-s-4);
  border-top: 1px solid var(--mm-border);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--mm-s-3);
  flex-wrap: wrap;
}
.auth-footer a {
  font-size: var(--mm-text-xs);
  color: var(--mm-text-muted);
  text-decoration: none;
}
.auth-footer a:hover { color: var(--mm-text-secondary); text-decoration: underline; }
.auth-footer-sep {
  font-size: var(--mm-text-xs);
  color: var(--mm-border);
}

/* ── Loader ────────────────────────────────────────────────── */
.auth-loader {
  position: fixed;
  inset: 0;
  background: rgba(255,255,255,0.88);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
}
.auth-loader.is-visible { display: flex; }

.auth-spinner {
  width: 44px;
  height: 44px;
  border: 3px solid var(--mm-border);
  border-top-color: var(--mm-brand-500);
  border-radius: 50%;
  animation: authSpin 0.75s linear infinite;
}
@keyframes authSpin { to { transform: rotate(360deg); } }

/* ── Responsive ────────────────────────────────────────────── */
@media (max-width: 560px) {
  .auth-card {
    border-radius: var(--mm-r-xl);
    padding: var(--mm-s-6) var(--mm-s-4);
  }
}

@media (max-width: 400px) {
  .auth-card { padding: var(--mm-s-5) var(--mm-s-3); }
}

@supports (-webkit-touch-callout: none) {
  body { padding-bottom: max(env(safe-area-inset-bottom), var(--mm-s-4)); }
}
