/* Cuenta — layout limpio (referencia) + colores J D STORE */
body.auth-page {
  margin: 0;
  min-height: 100dvh;
  font-family: Inter, system-ui, sans-serif;
  background: #fff;
  color: #111827;
}

body.auth-page--clean {
  padding: max(12px, env(safe-area-inset-top)) 22px max(28px, env(safe-area-inset-bottom));
  box-sizing: border-box;
}

.auth-fab-back {
  position: fixed;
  top: max(12px, env(safe-area-inset-top));
  left: 14px;
  z-index: 20;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  text-decoration: none;
  font-size: 1.2rem;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111;
}

.auth-fab-back--light {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.auth-brand-row {
  padding: 8px 0 28px;
  padding-left: 44px;
}

.auth-brand-lockup {
  display: flex;
  align-items: center;
  gap: 10px;
}

.auth-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 0.75rem;
  letter-spacing: 0.02em;
  color: var(--jd-black, #0a0a0a);
  background: var(--jd-green, #d9ef4a);
}

.auth-brand-name {
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
  color: #111827;
}

.auth-brand-stack {
  align-items: flex-start;
  gap: 0.14rem;
}

.auth-brand-stack .logo-tagline {
  color: #6b7280;
  letter-spacing: 0.18em;
  font-size: 0.52rem;
}

.auth-clean-main {
  width: min(420px, 100%);
  margin: 0 auto;
}

.auth-clean-title {
  margin: 0 0 10px;
  font-size: clamp(1.65rem, 6vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  color: #111827;
}

.auth-clean-lead {
  margin: 0 0 28px;
  font-size: 0.95rem;
  color: #6b7280;
  line-height: 1.5;
}

.auth-clean-subtitle {
  margin: 0 0 20px;
  font-size: 1.05rem;
  font-weight: 700;
  color: #111827;
}

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

.auth-field label {
  display: block;
  font-size: 0.88rem;
  font-weight: 600;
  color: #374151;
  margin-bottom: 8px;
}

.auth-field input {
  width: 100%;
  box-sizing: border-box;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #111827;
  padding: 14px 16px;
  font-size: 1rem;
}

.auth-field input:focus {
  outline: none;
  border-color: var(--jd-green-dark, #c5da34);
  box-shadow: 0 0 0 3px var(--jd-green-soft, rgba(217, 239, 74, 0.22));
}

.auth-input-wrap {
  position: relative;
}

.auth-input-wrap input {
  padding-right: 48px;
}

.auth-password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  border: none;
  background: transparent;
  color: #9ca3af;
  padding: 8px;
  cursor: pointer;
  border-radius: 8px;
}

.auth-password-toggle:hover {
  color: #374151;
}

.auth-otp-input {
  letter-spacing: 0.28em;
  font-size: 1.2rem !important;
  font-weight: 700;
  text-align: center;
}

.auth-field-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: -8px;
}

.auth-step-hint {
  margin: 0;
  font-size: 0.82rem;
  color: #6b7280;
}

.auth-step-hint--inline {
  flex: 1;
  min-width: 140px;
}

.auth-btn {
  border: none;
  border-radius: 12px;
  padding: 15px 16px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  background: var(--jd-green, #d9ef4a);
  color: var(--jd-black, #0a0a0a);
}

.auth-btn:hover {
  background: var(--jd-green-dark, #c5da34);
}

.auth-btn--full {
  width: 100%;
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: wait;
}

.auth-error {
  margin: 0;
  font-size: 0.86rem;
  color: #dc2626;
}

.auth-link-btn {
  background: none;
  border: none;
  color: var(--jd-green-dark, #9bc022);
  font-weight: 600;
  cursor: pointer;
  padding: 0;
  font-size: 0.9rem;
}

.auth-link-btn--right {
  font-size: 0.82rem;
  white-space: nowrap;
}

.auth-back-link {
  width: 100%;
  text-align: center;
  margin-top: -4px;
}

.auth-footer-switch {
  margin: 28px 0 0;
  text-align: center;
  font-size: 0.92rem;
  color: #6b7280;
}

.auth-footer-switch .auth-link-btn {
  margin-left: 4px;
  color: var(--jd-green-dark, #a8c93a);
  font-weight: 700;
}

.auth-logged {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.auth-user-chip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 0;
}

.auth-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 800;
  background: var(--jd-green-soft);
  color: var(--jd-green-dark);
  border: 2px solid var(--jd-green);
}

.auth-muted {
  margin: 4px 0 0;
  color: #6b7280;
  font-size: 0.88rem;
}

.auth-admin-link {
  color: var(--jd-green-dark);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

.auth-admin-link--block {
  text-align: center;
  padding: 14px;
  border-radius: 12px;
  border: 1px solid #e5e7eb;
}

.hidden {
  display: none !important;
}

.auth-terms-wrap {
  margin-top: -6px;
}

.auth-terms {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 0.86rem;
  color: #4b5563;
  line-height: 1.45;
}

.auth-terms input {
  margin-top: 3px;
  accent-color: var(--jd-green-dark);
}

.auth-steps--compact {
  display: flex;
  gap: 10px;
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
}

.auth-steps--compact .auth-step {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 0.75rem;
  font-weight: 700;
  color: #9ca3af;
  border: 2px solid #e5e7eb;
  background: #fff;
}

.auth-steps--compact .auth-step--active {
  border-color: var(--jd-green);
  background: var(--jd-green);
  color: var(--jd-black);
}

.auth-steps--compact .auth-step--done {
  border-color: var(--jd-green-muted);
  color: var(--jd-green-dark);
}

.auth-terms-dialog {
  border: none;
  border-radius: 16px;
  padding: 22px 18px;
  background: #fff;
  color: #111;
  max-width: min(420px, 92vw);
}

.auth-terms-dialog::backdrop {
  background: rgba(0, 0, 0, 0.5);
}

.auth-terms-dialog h2 {
  margin: 0 0 12px;
  font-size: 1.1rem;
}

.auth-terms-dialog p {
  margin: 0 0 18px;
  font-size: 0.9rem;
  color: #6b7280;
  line-height: 1.45;
}

/* Admin */
body.auth-page.admin-page {
  background: var(--jd-black, #0a0a0a);
  color: #fff;
  padding: 0;
}

body.admin-page .auth-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid var(--jd-green-soft);
  background: var(--jd-black);
}

body.admin-page .auth-back,
body.admin-page .auth-admin-link {
  color: var(--jd-green);
  text-decoration: none;
  font-weight: 600;
  font-size: 0.9rem;
}

body.admin-page .auth-brand {
  font-weight: 800;
  letter-spacing: 0.06em;
}

.admin-shell {
  display: flex;
  justify-content: center;
  padding: 24px 16px 48px;
}

.admin-card {
  width: min(920px, 100%);
  background: #111;
  border: 1px solid var(--jd-green-soft);
  border-radius: 18px;
  padding: 24px 20px;
  color: #fff;
}

.admin-card h1 {
  margin-top: 0;
}

.admin-stats {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-bottom: 20px;
}

.admin-stats div {
  background: #0a0a0a;
  border-radius: 12px;
  padding: 14px 16px;
  border: 1px solid var(--jd-green-soft);
}

.admin-stats strong {
  display: block;
  font-size: 1.4rem;
  color: var(--jd-green);
}

.admin-stats span {
  color: #9ca3af;
  font-size: 0.82rem;
}

.admin-table-wrap {
  overflow-x: auto;
  border-radius: 12px;
  border: 1px solid var(--jd-green-soft);
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  padding: 12px 14px;
  text-align: left;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.admin-table th {
  color: #9ca3af;
  font-weight: 600;
  background: #0c0c0c;
}

.admin-table select {
  background: #0a0a0a;
  color: #fff;
  border: 1px solid var(--jd-green-muted);
  border-radius: 8px;
  padding: 6px 8px;
}

.header-account-link {
  color: #f4f4f5;
  text-decoration: none;
  font-size: 0.82rem;
  font-weight: 600;
  padding: 8px 12px;
  border-radius: 999px;
  border: 1px solid var(--jd-green-muted);
  white-space: nowrap;
}

.header-account-link:hover {
  border-color: var(--jd-green);
  color: var(--jd-green);
}

@media (max-width: 640px) {
  .admin-table th:nth-child(4),
  .admin-table td:nth-child(4) {
    display: none;
  }
}
