/* Componentes de cuenta con la identidad visual de Torti Barbershop. */
:root {
  --admin-text: #0f172a;
  --admin-muted: #64748b;
  --admin-bg: #f3f6fb;
  --admin-surface: #ffffff;
  --admin-border: #e6ebf3;
  --admin-primary: #1a56db;
  --admin-primary-dark: #1e40af;
  --admin-violet: #8b5cf6;
}

/* Correo: estilo limpio, moderno y minimalista a juego con Cambiar Contraseña */
#profileChangeEmailModal.rpm-overlay {
  position: fixed !important;
  inset: 0 !important;
  z-index: 100500 !important;
  display: grid !important;
  place-items: center !important;
  box-sizing: border-box !important;
  padding: max(16px, env(safe-area-inset-top)) 16px max(16px, env(safe-area-inset-bottom)) !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
  background: rgba(15, 23, 42, .52) !important;
  backdrop-filter: blur(8px) !important;
  -webkit-backdrop-filter: blur(8px) !important;
}

#profileChangeEmailModal .rpm-card,
#profileChangeEmailModal .rpm-card--email {
  display: flex !important;
  flex-direction: column !important;
  width: min(420px, calc(100vw - 32px)) !important;
  max-width: 420px !important;
  max-height: calc(100vh - 32px) !important;
  margin: auto !important;
  overflow: hidden auto !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  background: #ffffff !important;
  box-shadow: 0 20px 50px rgba(15, 23, 42, .18), 0 0 0 1px rgba(15, 23, 42, .04) !important;
  color: #172033 !important;
  font-family: "Inter", system-ui, sans-serif !important;
  animation: rpmPasswordIn .2s cubic-bezier(.2, .8, .2, 1) both;
}
@supports (height: 100dvh) {
  #profileChangeEmailModal .rpm-card,
  #profileChangeEmailModal .rpm-card--email { max-height: calc(100dvh - 32px) !important; }
}

#profileChangeEmailModal .rpm-header {
  position: relative !important;
  display: flex !important;
  flex: 0 0 auto !important;
  align-items: center !important;
  gap: 12px !important;
  min-height: auto !important;
  padding: 16px 18px !important;
  border: 0 !important;
  border-bottom: 1px solid #edf2f7 !important;
  background: #fafbfc !important;
}

#profileChangeEmailModal .rpm-header__pattern {
  display: none !important;
}

#profileChangeEmailModal .rpm-header__icon--mail,
#profileChangeEmailModal .rpm-header__icon {
  display: grid !important;
  width: 38px !important;
  height: 38px !important;
  flex: 0 0 38px !important;
  place-items: center !important;
  border: 1px solid #dbeafe !important;
  border-radius: 10px !important;
  background: #eff6ff !important;
  color: #2563eb !important;
  box-shadow: none !important;
}

#profileChangeEmailModal .rpm-header__icon--mail svg,
#profileChangeEmailModal .rpm-header__icon svg {
  width: 18px !important;
  height: 18px !important;
  fill: none !important;
  stroke: #2563eb !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#profileChangeEmailModal .rpm-header__brand {
  display: grid !important;
  gap: 2px !important;
  min-width: 0 !important;
}

#profileChangeEmailModal .rpm-header__name {
  display: none !important;
}

#profileChangeEmailModal .rpm-header__sub {
  color: #0f172a !important;
  font: 700 0.95rem/1.3 "Inter", system-ui, sans-serif !important;
  letter-spacing: -0.01em !important;
  text-transform: none !important;
}

#profileChangeEmailModal .rpm-close {
  display: grid !important;
  width: 32px !important;
  height: 32px !important;
  flex: 0 0 32px !important;
  place-items: center !important;
  margin-left: auto !important;
  border: 0 !important;
  border-radius: 8px !important;
  background: transparent !important;
  color: #94a3b8 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease !important;
}

#profileChangeEmailModal .rpm-close:hover {
  background: #f1f5f9 !important;
  color: #0f172a !important;
}

#profileChangeEmailModal .rpm-close svg {
  width: 16px !important;
  height: 16px !important;
}

#profileChangeEmailModal .rpm-body {
  display: grid !important;
  gap: 16px !important;
  padding: 20px 18px 18px !important;
  background: #ffffff !important;
}

#profileChangeEmailModal .rpm-title-wrap {
  margin: 0 !important;
}

#profileChangeEmailModal .rpm-title {
  display: none !important;
}

#profileChangeEmailModal .rpm-subtitle {
  margin: 0 !important;
  color: #64748b !important;
  font-size: .82rem !important;
  line-height: 1.5 !important;
}

#profileChangeEmailModal .rpm-field {
  display: grid !important;
  gap: 6px !important;
  min-width: 0 !important;
}

#profileChangeEmailModal .rpm-label {
  color: #475569 !important;
  font: 600 .74rem/1.35 "Inter", system-ui, sans-serif !important;
  letter-spacing: .01em !important;
  text-transform: none !important;
}

#profileChangeEmailModal .rpm-input-wrap {
  display: flex !important;
  min-height: 44px !important;
  align-items: center !important;
  gap: 8px !important;
  padding: 0 10px !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 10px !important;
  background: #fafbfc !important;
  box-shadow: none !important;
  transition: border-color .15s ease, box-shadow .15s ease, background .15s ease !important;
}

#profileChangeEmailModal .rpm-input-wrap:focus-within {
  border-color: #2563eb !important;
  background: #ffffff !important;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12) !important;
}

#profileChangeEmailModal .rpm-input-icon {
  width: 16px !important;
  height: 16px !important;
  flex: 0 0 16px !important;
  color: #94a3b8 !important;
}

#profileChangeEmailModal .rpm-input {
  width: 100% !important;
  min-width: 0 !important;
  padding: 10px 4px !important;
  border: 0 !important;
  outline: 0 !important;
  background: transparent !important;
  color: #172033 !important;
  font-family: "Inter", system-ui, sans-serif !important;
  font-size: 16px !important; /* Mínimo 16px para evitar auto-zoom en iOS Safari y Android Chrome */
  font-weight: 500 !important;
  line-height: 1.4 !important;
  box-shadow: none !important;
}

#profileChangeEmailModal .rpm-input::placeholder {
  color: #94a3b8 !important;
}

#profileChangeEmailModal .rpm-email-note {
  margin: -4px 0 0 !important;
  color: #64748b !important;
  font-size: .78rem !important;
  line-height: 1.45 !important;
}

#profileChangeEmailModal .rpm-actions {
  display: grid !important;
  grid-template-columns: 1fr 1fr !important;
  gap: 8px !important;
  margin-top: 4px !important;
}

#profileChangeEmailModal .rpm-actions .rpm-btn {
  min-width: 0 !important;
  min-height: 42px !important;
  margin: 0 !important;
  padding: 10px 14px !important;
  border: 1px solid transparent !important;
  border-radius: 10px !important;
  font: 600 .82rem/1.2 "Inter", system-ui, sans-serif !important;
  letter-spacing: 0 !important;
  box-shadow: none !important;
  cursor: pointer !important;
  transition: background .15s ease, border-color .15s ease !important;
}

#profileChangeEmailModal .rpm-actions .rpm-btn:not(.rpm-btn--secondary) {
  border-color: transparent !important;
  background: #1d4ed8 !important;
  color: #ffffff !important;
}

#profileChangeEmailModal .rpm-actions .rpm-btn:not(.rpm-btn--secondary):hover:not(:disabled) {
  background: #1e40af !important;
}

#profileChangeEmailModal .rpm-btn--secondary {
  background: #f8fafc !important;
  color: #475569 !important;
  border: 1px solid #e2e8f0 !important;
}

#profileChangeEmailModal .rpm-btn--secondary:hover:not(:disabled) {
  background: #f1f5f9 !important;
  border-color: #cbd5e1 !important;
}

#profileChangeEmailModal .rpm-status-slot {
  min-height: 0 !important;
  margin: 0 !important;
}

#profileChangeEmailModal .rpm-status {
  padding: 10px 12px !important;
  border-radius: 10px !important;
  font-size: .8rem !important;
  line-height: 1.45 !important;
}

#profileChangeEmailModal :is(.rpm-close, .rpm-btn):focus-visible {
  outline: 3px solid rgba(37, 99, 235, .35) !important;
  outline-offset: 2px !important;
}

@media (max-width: 520px) {
  #profileChangeEmailModal.rpm-overlay {
    padding: max(10px, env(safe-area-inset-top)) 10px max(10px, env(safe-area-inset-bottom)) !important;
  }
  #profileChangeEmailModal .rpm-card,
  #profileChangeEmailModal .rpm-card--email {
    width: min(100%, calc(100vw - 20px)) !important;
    border-radius: 16px !important;
  }
  #profileChangeEmailModal .rpm-header {
    padding: 14px 16px !important;
  }
  #profileChangeEmailModal .rpm-body {
    gap: 14px !important;
    padding: 18px 16px 16px !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   TÉRMINOS Y CONDICIONES (Políticas): Diseño estilo App Nativa
   ═══════════════════════════════════════════════════════════════════ */
.tc-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  animation: tcOverlayIn 0.2s cubic-bezier(0.16, 1, 0.3, 1) both;
}

.tc-card {
  position: relative;
  display: flex;
  flex-direction: column;
  width: min(540px, calc(100vw - 32px));
  height: min(720px, calc(100dvh - 48px));
  max-height: calc(100vh - 48px);
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.85);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.25), 0 0 0 1px rgba(15, 23, 42, 0.04);
  color: #0f172a;
  font-family: "Inter", system-ui, sans-serif;
  animation: tcCardIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
}

/* ── Top Appbar / Navbar ── */
.tc-head {
  position: relative;
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px 16px;
  border-bottom: 1px solid #edf2f7;
  background: #ffffff;
}

.tc-head-info {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  align-items: center;
  gap: 12px;
}

.tc-head-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  flex: 0 0 auto !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #2563eb !important;
  padding: 0 !important;
}

.tc-head-icon svg {
  display: block !important;
  width: 24px !important;
  height: 24px !important;
  fill: none !important;
  stroke: #2563eb !important;
  stroke-width: 1.8 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

#profileTermsModal .tc-title {
  margin: 0;
  color: #0f172a !important;
  font: 800 1.05rem/1.25 "Inter", system-ui, sans-serif !important;
  letter-spacing: -0.015em !important;
  text-transform: none !important;
}

#profileTermsModal .tc-subtitle {
  margin: 2px 0 0;
  color: #64748b !important;
  font: 500 0.74rem/1.35 "Inter", system-ui, sans-serif !important;
  letter-spacing: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#profileTermsModal .tc-close-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: auto !important;
  height: auto !important;
  min-width: unset !important;
  flex: 0 0 auto !important;
  margin-left: auto !important;
  padding: 0 !important;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  color: #64748b !important;
  cursor: pointer !important;
  -webkit-tap-highlight-color: transparent !important;
  transition: color 0.15s ease, transform 0.15s ease !important;
}

#profileTermsModal .tc-close-btn:hover {
  background: transparent !important;
  border: 0 !important;
  color: #0f172a !important;
  transform: scale(1.15) !important;
}

#profileTermsModal .tc-close-btn:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
}

#profileTermsModal .tc-close-btn svg {
  display: block !important;
  width: 22px !important;
  height: 22px !important;
  fill: none !important;
  stroke: currentColor !important;
  stroke-width: 2.2 !important;
  stroke-linecap: round !important;
  stroke-linejoin: round !important;
}

/* ── Contenido: formato lista de tarjetas de App ── */
.tc-body {
  display: flex;
  flex: 1 1 auto;
  min-height: 0;
  flex-direction: column;
  gap: 10px;
  overflow-y: auto;
  padding: 16px 18px;
  overscroll-behavior: contain;
  background: #f8fafc;
  scrollbar-width: thin;
  scrollbar-color: #cbd5e1 transparent;
}

.tc-section {
  padding: 14px 16px;
  border: 1px solid #eef2f6;
  border-radius: 14px;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.03);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.tc-section:hover {
  border-color: #cbd5e1;
  box-shadow: 0 3px 8px rgba(15, 23, 42, 0.04);
}

.tc-section-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 6px;
  color: #0f172a;
  font: 700 0.88rem/1.35 "Inter", system-ui, sans-serif;
  letter-spacing: -0.01em;
}

.tc-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  flex: 0 0 22px;
  border-radius: 6px;
  background: #eff6ff;
  color: #2563eb;
  font: 750 0.7rem/1 "Inter", sans-serif;
  letter-spacing: 0;
}

.tc-section-text {
  margin: 0;
  color: #475569;
  font-size: 0.82rem;
  line-height: 1.55;
}

.tc-section-text strong {
  color: #1e40af;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ── Bottom Appbar / Footer ── */
.tc-foot {
  flex: 0 0 auto;
  padding: 14px 18px max(14px, env(safe-area-inset-bottom));
  border-top: 1px solid #edf2f7;
  background: #ffffff;
}

.tc-foot .tc-btn-primary {
  width: 100%;
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  background: #2563eb;
  color: #ffffff;
  font: 700 0.9rem/1 "Inter", sans-serif;
  letter-spacing: 0.01em;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.22);
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease, box-shadow 0.15s ease;
}

.tc-foot .tc-btn-primary:hover {
  background: #1d4ed8;
  box-shadow: 0 6px 16px rgba(37, 99, 235, 0.32);
  transform: translateY(-1px);
}

.tc-foot .tc-btn-primary:active {
  transform: scale(0.99);
}

.tc-foot .tc-btn-primary:focus-visible {
  outline: 3px solid rgba(37, 99, 235, 0.35);
  outline-offset: 2px;
}

/* ── Móvil: pantalla completa estilo página nativa (iOS) ──
   Réplica del diseño de referencia: header gris con flecha azul a la izquierda
   y título centrado, contenido blanco con tipografía ligera y párrafos
   justificados, barra gris inferior. */
@media all {
  .tc-overlay {
    align-items: stretch;
    justify-content: stretch;
    padding: 0;
    background: #ffffff;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .tc-card {
    width: 100%;
    height: 100dvh;
    max-height: none;
    border: 0;
    border-radius: 0;
    background: #ffffff;
    box-shadow: none;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
    animation: none;
  }
  .tc-card::before { display: none; }

  /* Header: gris claro, flecha izquierda, título centrado */
  .tc-head {
    position: relative;
    justify-content: center;
    gap: 0;
    min-height: calc(56px + env(safe-area-inset-top, 0px));
    padding: env(safe-area-inset-top, 0px) 56px 0;
    border-bottom: 1px solid #e4e4e7;
    background: #f8f8f8;
  }
  .tc-head-info {
    flex: 1 1 auto;
    justify-content: center;
    gap: 0;
    text-align: center;
  }
  .tc-head-icon,
  #profileTermsModal .tc-subtitle {
    display: none !important;
  }
  #profileTermsModal .tc-title {
    margin: 0;
    color: #0c2026 !important;
    font: 600 17px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif !important;
    letter-spacing: -0.01em !important;
    text-align: center;
  }

  /* El botón de cierre pasa a ser la flecha "atrás" azul, a la izquierda */
  #profileTermsModal .tc-close-btn {
    position: absolute !important;
    left: 12px !important;
    bottom: 0 !important;
    width: 44px !important;
    height: 56px !important;
    margin: 0 !important;
    font-size: 0 !important;
    color: transparent !important;
    background: transparent no-repeat center / 24px 24px !important;
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%233b82f6' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><path d='M20 12H4'/><path d='M10 6l-6 6 6 6'/></svg>") !important;
  }
  #profileTermsModal .tc-close-btn:hover {
    transform: none !important;
    background-color: transparent !important;
  }
  #profileTermsModal .tc-close-btn svg {
    display: none !important;
  }

  /* Contenido: blanco, sin tarjetas, texto corrido y justificado */
  .tc-body {
    display: block;
    padding: 46px 18px 48px;
    background: #ffffff;
    color: #3a3a3c;
    font-size: 15px;
    line-height: 1.4;
    -webkit-overflow-scrolling: touch;
  }

  .tc-body h1 {
    margin: 0 0 20px;
    color: #222222;
    font: 300 33px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: uppercase;
  }
  .tc-body h2,
  .tc-section-title {
    display: block;
    margin: 36px 0 15px;
    color: #222222;
    font: 300 20px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    letter-spacing: 0;
  }
  .tc-body h3 {
    margin: 28px 0 12px;
    color: #222222;
    font: 400 17px/1.3 -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  }
  .tc-body p,
  .tc-section-text {
    margin: 0 0 14px;
    color: #3a3a3c;
    font-size: 15px;
    line-height: 1.4;
    text-align: justify;
  }
  .tc-body ul,
  .tc-body ol {
    margin: 0 0 14px;
    padding-left: 22px;
    text-align: justify;
  }
  .tc-body li {
    margin: 0 0 6px;
    font-size: 15px;
    line-height: 1.4;
  }

  /* Las "tarjetas" desaparecen: todo fluye como un documento */
  .tc-section {
    padding: 0;
    margin: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }
  .tc-section:hover {
    border: 0;
    box-shadow: none;
  }
  .tc-number {
    display: none;
  }
  .tc-section-text strong,
  .tc-body strong {
    padding: 0;
    border-radius: 0;
    background: transparent;
    color: inherit;
    font-weight: 600;
  }
  .tc-body a {
    color: #3b82f6;
    text-decoration: none;
  }


  /* Título del header: siempre visible y centrado */
  #profileTermsModal .tc-head .tc-title {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }
  #profileTermsModal .tc-head-info > div {
    min-width: 0;
    flex: 0 1 auto;
    text-align: center;
  }

  /* Título grande del contenido (primer encabezado del documento) */
  .tc-body > h1,
  .tc-body > .tc-section:first-child > .tc-section-title:first-child,
  .tc-body > .tc-section-title:first-child {
    margin: 0 0 20px;
    color: #222222;
    font: 300 33px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
    letter-spacing: 0;
    text-transform: uppercase;
  }

  /* Barra inferior: franja gris vacía (el botón queda oculto visualmente) */
  .tc-foot {
    height: max(43px, env(safe-area-inset-bottom, 0px));
    padding: 0;
    border-top: 0;
    background: #f4f4f5;
  }
  .tc-foot .tc-btn-primary {
    position: absolute;
    width: 1px;
    height: 1px;
    min-height: 0;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    opacity: 0;
  }
}

/* ── Laptop / escritorio: la misma pantalla, centrada como tarjeta ── */
@media (min-width: 641px) {
  .tc-overlay {
    align-items: center;
    justify-content: center;
    padding: 24px;
    background: rgba(15, 23, 42, 0.55);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
  }
  .tc-card {
    width: min(480px, calc(100vw - 32px));
    height: min(820px, calc(100dvh - 48px));
    border-radius: 18px;
    box-shadow: 0 25px 60px -15px rgba(15, 23, 42, 0.35), 0 0 0 1px rgba(15, 23, 42, 0.06);
    animation: tcCardIn 0.22s cubic-bezier(0.16, 1, 0.3, 1) both;
  }
  .tc-head {
    min-height: 56px;
    padding-top: 0;
  }
  .tc-body {
    scrollbar-width: thin;
    scrollbar-color: #d4d4d8 transparent;
  }
  .tc-foot {
    height: 43px;
  }
}

@keyframes tcOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes tcCardIn {
  from { opacity: 0; transform: translateY(12px) scale(0.98); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (prefers-reduced-motion: reduce) {
  .tc-overlay, .tc-card { animation: none; }
}