/* ============================================================================
 * cuenta-correo.css — Recuperación de contraseña por código, registro de correo
 * (modal + bloque en Mi perfil) y pestaña "Accesos" del panel de admin.
 * Reversible: quitar este <link> junto con js/cuenta-correo.js y js/admin-accesos.js.
 * ==========================================================================*/

/* ------------------------------- login ---------------------------------- */
/* Lo marcado como oculto se oculta siempre (algunas clases del login fijan display:flex). */
.auth-gate [hidden] { display: none !important; }
.auth-otp { letter-spacing: 6px; font-variant-numeric: tabular-nums; font-weight: 600; }
.auth-otp::placeholder { letter-spacing: .2px; font-weight: 400; }

.auth-reqs {
  list-style: none; margin: 10px 2px 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: 5px 12px;
  font-size: 11.5px; color: rgba(255, 255, 255, .62);
}
.auth-reqs li { display: flex; align-items: center; gap: 6px; transition: color .15s ease; }
.auth-reqs li::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, .45); flex: 0 0 auto; transition: all .15s ease;
}
.auth-reqs li.ok { color: #c9f7dc; }
.auth-reqs li.ok::before { background: #4ade80; border-color: #4ade80; }

.auth-rec-links { display: flex; justify-content: space-between; margin: 12px 2px 0; font-size: 12.5px; }
.auth-rec-admin { margin-top: 16px; font-size: 12px; color: rgba(255, 255, 255, .7); text-align: center; }

/* Resultado de "Recuperar": te enviamos un enlace a g*****2@… */
.auth-rec-res { text-align: center; padding: 6px 2px 0; }
.auth-rec-res__ico {
  width: 56px; height: 56px; margin: 4px auto 12px; border-radius: 18px;
  display: grid; place-items: center; font-size: 26px; color: #fff;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  box-shadow: 0 12px 26px -12px rgba(67, 56, 202, .9), inset 0 1px 0 rgba(255, 255, 255, .35);
  animation: correo-in .35s cubic-bezier(.16, 1, .3, 1) both;
}
.auth-rec-res__ico--warn { background: linear-gradient(135deg, #f59e0b, #b45309); box-shadow: 0 12px 26px -12px rgba(180, 83, 9, .9); }
.auth-rec-res p { margin: 0 0 8px; font-size: 14px; line-height: 1.5; color: #fff; }
.auth-rec-res .auth-rec-res__tip {
  margin: 10px 0 4px; padding: 10px 12px; border-radius: 12px; text-align: left;
  font-size: 12.5px; line-height: 1.5; color: rgba(255, 255, 255, .88);
  background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .18);
}
.auth-2p-tip { margin: 10px 2px 0; font-size: 12px; line-height: 1.45; color: rgba(255, 255, 255, .75); }

/* Guía "¿No lo ves?" dentro de las ventanas de la app (registrar correo, cambiar contraseña). */
.correo-buscar {
  margin: -4px 0 14px; padding: 10px 12px; border-radius: 12px; font-size: 12.5px; line-height: 1.5;
  background: #F8FAFC; border: 1px solid #E2E8F0; color: var(--ink, #1F2340);
}
.correo-buscar ul { margin: 6px 0 0; padding-left: 18px; }
.correo-buscar li { margin: 2px 0; }
.perfil-cp .correo-buscar { margin: 8px 0 4px; }
html[data-theme="dark"] .correo-buscar { background: #2b2e34; border-color: #3a3d44; color: #e5e7eb; }

/* Verificación en dos pasos (admins) */
#auth-dos-pasos .auth-sol-head .auth-rec-res__ico { margin-bottom: 10px; }
.auth-2p-confiar { margin: 14px 2px 0; font-size: 12.5px; color: rgba(255, 255, 255, .85); }

/* Crear contraseña desde el enlace */
#auth-enlace .auth-sol-head p b { color: #fff; }
.auth-enl-match { min-height: 16px; margin: 8px 2px 0; font-size: 12px; color: rgba(255, 255, 255, .7); }
.auth-enl-match.si { color: #86efac; }
.auth-enl-match.no { color: #fecaca; }

/* --------------------- modal de correo (dentro de la app) ---------------- */
.correo-modal { z-index: 8200; }                 /* encima de Mi perfil */
.correo-card { text-align: left; animation: correo-in .32s cubic-bezier(.16, 1, .3, 1) both; }
@keyframes correo-in { from { opacity: 0; transform: translateY(10px) scale(.98); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .correo-card { animation: none; } }

.correo-ico {
  width: 46px; height: 46px; border-radius: 14px; margin-bottom: 12px;
  display: grid; place-items: center; font-size: 22px; color: #fff;
  background: linear-gradient(135deg, #6366f1 0%, #312e81 100%);
  box-shadow: 0 10px 24px -10px rgba(49, 46, 129, .8), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.correo-ico--ok { background: linear-gradient(135deg, #22c55e 0%, #15803d 100%); box-shadow: 0 10px 24px -10px rgba(21, 128, 61, .8); }
.correo-txt { font-size: 13px; line-height: 1.5; color: var(--muted, #5F6673); margin: -6px 0 14px; }
.correo-usos { list-style: none; margin: -8px 0 12px; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.correo-usos li { font-size: 13px; line-height: 1.4; color: var(--ink, #1F2340); padding: 8px 10px; border-radius: 10px; background: #F8FAFC; border: 1px solid #E2E8F0; }
html[data-theme="dark"] .correo-usos li { background: #2b2e34; border-color: #3a3d44; color: #e5e7eb; }
.correo-dev {
  font-size: 12px; line-height: 1.4; margin: 0 0 12px; padding: 8px 10px; border-radius: 10px;
  background: rgba(245, 158, 11, .12); border: 1px dashed rgba(217, 119, 6, .5); color: #92400e;
}

.correo-input {
  display: flex; align-items: stretch; border: 1px solid var(--line, #E3E9ED); border-radius: 10px; overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.correo-input:focus-within { border-color: #6366f1; box-shadow: 0 0 0 3px rgba(99, 102, 241, .18); }
.admin-field .correo-input input { border: 0 !important; box-shadow: none !important; border-radius: 0 !important; min-width: 0; flex: 1; }
.correo-input span {
  display: flex; align-items: center; padding: 0 12px; font-size: 13px; white-space: nowrap;
  color: var(--muted, #5F6673); background: rgba(99, 102, 241, .07); border-left: 1px solid var(--line, #E3E9ED);
}
.correo-input.con-arroba span { display: none; }

.admin-field input.correo-otp {
  text-align: center; font-size: 24px !important; font-weight: 700; letter-spacing: 10px;
  font-variant-numeric: tabular-nums; padding: 12px !important;
}
.correo-links { display: flex; justify-content: space-between; gap: 10px; margin-top: 2px; }
.correo-link, .pf-usar-codigo {
  background: none; border: 0; padding: 4px 0; cursor: pointer; font: inherit; font-size: 12.5px;
  color: #4f46e5; text-align: left;
}
.correo-link:hover, .pf-usar-codigo:hover { text-decoration: underline; }
.correo-link:disabled, .pf-usar-codigo:disabled { opacity: .6; cursor: default; text-decoration: none; }
.pf-usar-codigo { margin-top: 6px; display: block; }
.correo-card .auth-msg, .perfil-cp .auth-msg--ok { margin-top: 4px; }
.correo-card .auth-msg--error, .perfil-card .auth-msg--error, #accesos-modal .auth-msg--error { background: rgba(226, 42, 98, .08); border: 1px solid rgba(226, 42, 98, .3); color: #b0174a; }
.correo-card .auth-msg--ok, .perfil-card .auth-msg--ok { background: rgba(21, 163, 74, .1); border: 1px solid rgba(21, 163, 74, .35); color: #166534; }

/* Bloque "Correo" en Mi perfil */
.perfil-correo {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  margin: -4px 0 16px; padding: 12px 14px; border-radius: 12px;
  background: rgba(99, 102, 241, .06); border: 1px solid rgba(99, 102, 241, .18);
}
.perfil-correo > div { display: flex; flex-direction: column; min-width: 0; }
.perfil-correo span { font-size: 11px; color: var(--muted, #6A7C8A); text-transform: uppercase; letter-spacing: .03em; }
.perfil-correo b { font-size: 13.5px; color: var(--ink, #0E1620); overflow-wrap: anywhere; }
.perfil-correo__ok { font-style: normal; font-weight: 600; font-size: 11.5px; color: #15803d; margin-left: 4px; white-space: nowrap; }
.perfil-correo__falta { color: #b45309 !important; }
.perfil-correo__pend { font-style: normal; font-weight: 600; font-size: 11.5px; color: #b45309; margin-left: 4px; white-space: nowrap; }

/* Mi perfil: encabezado compacto + cambio de contraseña plegado */
.pf-head { display: flex; align-items: center; gap: 14px; margin: 0 0 14px; }
.pf-avatar {
  width: 52px; height: 52px; border-radius: 16px; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; font-size: 18px; color: #fff; letter-spacing: .5px;
  background: linear-gradient(135deg, #6366f1, #4338ca);
  box-shadow: 0 10px 22px -12px rgba(67, 56, 202, .9), inset 0 1px 0 rgba(255, 255, 255, .3);
}
.pf-head__txt { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.pf-head__txt b { font-size: 16px; color: var(--ink, #0E1620); line-height: 1.25; }
.pf-head__txt span { font-size: 12.5px; color: var(--muted, #6A7C8A); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pf-x {
  align-self: flex-start; width: 32px; height: 32px; border-radius: 10px; border: 0; cursor: pointer;
  background: rgba(15, 23, 42, .05); color: var(--muted, #6A7C8A); font-size: 20px; line-height: 1;
}
.pf-x:hover { background: rgba(15, 23, 42, .1); color: var(--ink, #0E1620); }
.perfil-card .perfil-correo { margin: 0 0 10px; }
/* Teléfono en Mi perfil (el vendedor lo cambia con su contraseña) */
.pf-tel { margin: 0 0 10px; }
.pf-tel__fila {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px 14px; border-radius: 12px; background: #F8FAFC; border: 1px solid #E2E8F0;
}
.pf-tel__fila > div { display: flex; flex-direction: column; min-width: 0; }
.pf-tel__fila span { font-size: 11px; color: var(--muted, #6A7C8A); text-transform: uppercase; letter-spacing: .03em; }
.pf-tel__fila b { font-size: 14px; color: var(--ink, #0E1620); font-variant-numeric: tabular-nums; }
.pf-tel__vacio { font-style: normal; font-weight: 500; color: var(--muted, #8A93A0); }
.pf-tel__form { padding: 12px 14px; border-radius: 12px; border: 1px solid #C7D2FE; background: #F8F9FF; }
.pf-tel__titulo { font-weight: 700; font-size: 13.5px; margin-bottom: 10px; color: var(--ink, #0E1620); }
.pf-tel__form .admin-field { margin-bottom: 10px; }
.pf-tel__form .admin-field label { margin-bottom: 4px; min-height: 0 !important; }
.pf-tel__form .admin-modal__actions { margin-top: 4px; }
.pf-tel__ok { margin-top: 8px; }
html[data-theme="dark"] .pf-tel__fila { background: #2b2e34; border-color: #3a3d44; }
html[data-theme="dark"] .pf-tel__fila b { color: #f1f3f6; }
html[data-theme="dark"] .pf-tel__form { background: #26282c; border-color: #4b4f8a; }

.pf-abrir-cp {
  width: 100%; display: flex; align-items: center; gap: 10px; padding: 12px 14px; cursor: pointer;
  border: 1px solid var(--line, #E3E9ED); border-radius: 12px; background: var(--paper, #fff);
  font: inherit; font-size: 14px; font-weight: 600; color: var(--ink, #1F2340); text-align: left;
  transition: border-color .15s ease, background .15s ease;
}
.pf-abrir-cp:hover { border-color: #6366f1; background: rgba(99, 102, 241, .04); }
.pf-abrir-cp i { margin-left: auto; font-style: normal; font-size: 20px; color: var(--muted, #8A93A0); }
.pf-abrir-cp[hidden], #pf-acciones-base[hidden], .perfil-cp[hidden] { display: none !important; }
.pf-cp-head { font-weight: 700; font-size: 14.5px; margin: 14px 0 10px; padding-top: 14px; border-top: 1px solid var(--line, #E3E9ED); color: var(--ink, #0E1620); }
/* Selector de método: la opción elegida en índigo sólido, la otra en gris neutro. */
.pf-metodo { display: flex; gap: 4px; padding: 4px; border-radius: 12px; background: #F1F5F9; border: 1px solid #E2E8F0; margin-bottom: 12px; }
.pf-metodo button {
  flex: 1; border: 0; background: transparent; padding: 9px 10px; border-radius: 9px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: #64748B; transition: all .15s ease;
}
.pf-metodo button:not(.is-on):hover { background: #E2E8F0; color: #334155; }
.pf-metodo button.is-on {
  background: linear-gradient(135deg, #6366F1, #4338CA); color: #fff;
  box-shadow: 0 6px 14px -8px rgba(67, 56, 202, .9);
}
.pf-metodo button:disabled { opacity: .7; }
.perfil-card .perfil-cp .admin-field { margin-bottom: 10px; }
.perfil-card .perfil-cp .admin-field label { margin-bottom: 4px; }
.perfil-card .pf-reqs { margin: 8px 0 10px; gap: 4px 14px; }
.perfil-card #pf-acciones-base { margin-top: 14px; justify-content: flex-end; }
/* Recuadro del correo según su estado: ámbar si falta, verde si está confirmado. */
.perfil-correo.perfil-correo--falta { background: #FFFBEB; border-color: #FCD34D; }
.perfil-correo.perfil-correo--falta span { color: #92400E; }
.perfil-correo.perfil-correo--ok { background: #F0FDF4; border-color: #BBF7D0; }
.perfil-correo.perfil-correo--ok span { color: #166534; }
html[data-theme="dark"] .pf-metodo { background: #2b2e34; border-color: #3a3d44; }
html[data-theme="dark"] .perfil-correo.perfil-correo--falta { background: rgba(245, 158, 11, .12); border-color: rgba(245, 158, 11, .4); }
html[data-theme="dark"] .perfil-correo.perfil-correo--ok { background: rgba(34, 197, 94, .1); border-color: rgba(34, 197, 94, .35); }
html[data-theme="dark"] .pf-head__txt b { color: #f1f3f6; }

/* Plazo para registrar correo (dentro del aviso) */
.correo-plazo {
  margin: -4px 0 14px; padding: 9px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.45;
  background: rgba(99, 102, 241, .08); border: 1px solid rgba(99, 102, 241, .22); color: #3730a3;
}
.correo-plazo--vencido { background: rgba(226, 42, 98, .08); border-color: rgba(226, 42, 98, .3); color: #9f1239; font-weight: 600; }

/* Panel admin: usuarios pendientes de activar, correo en Editar / Nuevo usuario */
.pill--pend { background: #FEF3C7; color: #92400E; font-weight: 700; }
.ed-correo-est { margin-left: 6px; font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.ed-correo-est--ok { background: #DCFCE7; color: #166534; }
.ed-correo-est--pend { background: #FEF3C7; color: #92400E; }
.ed-correo-est--no { background: #F1F5F9; color: #64748B; }
/* Nuevo usuario: formulario compacto en 2 columnas */
.admin-modal__card.nu-card { max-width: 540px; }
.nu-card h3 { margin-bottom: 14px !important; }
.nu-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; }
.nu-grid .nu-full { grid-column: 1 / -1; }
.nu-grid .admin-field { margin: 0 !important; }
.nu-grid .admin-field label { margin-bottom: 4px !important; font-size: 12px; }
/* El tema da 44 px de alto mínimo a las etiquetas (área táctil); en estas ventanas el
   toque va al campo, así que la etiqueta mide solo su texto. */
.nu-card .admin-field label, .perfil-card .admin-field label, .correo-card .admin-field label,
#admin-modal .admin-field label, #accesos-modal .admin-field label { min-height: 0 !important; }
.nu-card .nu-check, .perfil-card .pf-reqs li { min-height: 0 !important; }
.nu-grid .admin-field label small { font-weight: 400; color: var(--muted, #8A93A0); }
.nu-grid .admin-field input, .nu-grid .admin-field select { padding: 9px 12px !important; }
.nu-check { display: flex; align-items: center; gap: 8px; margin: 12px 0 0; font-size: 12.5px; cursor: pointer; color: var(--ink, #1F2340); }
.nu-check input { margin: 0; width: 15px; height: 15px; accent-color: #4F46E5; flex: 0 0 auto; }
.nu-check small { color: var(--muted, #6A7C8A); }
.nu-check[hidden] { display: none !important; }
.nu-card .nu-ayuda { margin-top: 12px; padding: 8px 12px; }
@media (max-width: 560px) {
  .nu-grid { grid-template-columns: 1fr; }
}

.ed-correo-ayuda, .nu-sincorreo small { display: block; margin-top: 5px; font-size: 11.5px; line-height: 1.4; color: var(--muted, #6A7C8A); }
.nu-sincorreo { display: flex; align-items: flex-start; gap: 8px; margin: -4px 0 12px; font-size: 12.5px; cursor: pointer; color: var(--ink, #0E1620); }
.nu-sincorreo input { margin-top: 2px; }
.nu-sincorreo small { display: inline; margin: 0; }
.nu-ayuda {
  margin: 6px 0 0; padding: 10px 12px; border-radius: 10px; font-size: 12.5px; line-height: 1.5;
  background: rgba(99, 102, 241, .07); border: 1px solid rgba(99, 102, 241, .18); color: var(--ink, #1F2340);
}

/* --------------------------- admin: Accesos ------------------------------ */
.acc-aviso {
  margin-bottom: 12px; padding: 10px 14px; border-radius: 12px; font-size: 13px; line-height: 1.45;
  background: rgba(245, 158, 11, .12); border: 1px solid rgba(217, 119, 6, .35); color: #92400e;
}
.acc-barra { height: 6px; border-radius: 999px; background: rgba(99, 102, 241, .12); overflow: hidden; margin: -2px 0 14px; }
.acc-barra i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, #6366f1, #22c1d2); transition: width .4s ease; }

.acc-top { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 12px; }
.acc-seg { display: inline-flex; padding: 3px; border-radius: 999px; background: rgba(99, 102, 241, .08); }
.acc-seg button {
  border: 0; background: transparent; padding: 7px 14px; border-radius: 999px; cursor: pointer;
  font: inherit; font-size: 12.5px; font-weight: 600; color: var(--muted, #5F6673); transition: all .15s ease;
}
.acc-seg button.is-on { background: #fff; color: #312e81; box-shadow: 0 2px 8px -2px rgba(49, 46, 129, .3); }
.acc-filtros { display: flex; gap: 8px; flex-wrap: wrap; }
.acc-filtros input, .acc-filtros select {
  padding: 8px 11px; border: 1px solid var(--line, #E3E9ED); border-radius: 10px; font: inherit; font-size: 12.5px;
  background: var(--paper, #fff); color: var(--ink, #0E1620);
}
.acc-filtros input { min-width: 230px; }

.acc-rows { display: flex; flex-direction: column; }
.acc-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 4px;
  border-bottom: 1px solid var(--line, #E3E9ED);
}
.acc-row:last-child { border-bottom: 0; }
.acc-row.is-off { opacity: .55; }
.acc-row__main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.acc-row__main b { font-size: 13.5px; }
.acc-row__main span { font-size: 12px; color: var(--muted, #6A7C8A); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.acc-row__fecha { font-size: 12px; color: var(--muted, #6A7C8A); white-space: nowrap; min-width: 110px; text-align: right; }
.acc-correo { font-size: 12.5px; color: var(--ink, #0E1620); overflow-wrap: anywhere; }

.acc-tag { font-size: 11.5px; font-weight: 600; padding: 4px 9px; border-radius: 999px; white-space: nowrap; }
.acc-tag--rec   { background: rgba(21, 163, 74, .12);  color: #15803d; }
.acc-tag--cam   { background: rgba(34, 193, 210, .14); color: #0e7490; }
.acc-tag--reg   { background: rgba(99, 102, 241, .12); color: #4338ca; }
.acc-tag--adm   { background: rgba(100, 116, 139, .14); color: #475569; }
.acc-tag--falta { background: rgba(245, 158, 11, .14); color: #b45309; }
.acc-tag--pend  { background: #FEF3C7; color: #92400E; }

/* Fecha límite para registrar correo */
.acc-fecha { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 12px; }
.acc-fecha__txt { display: flex; flex-direction: column; gap: 3px; min-width: 0; flex: 1 1 280px; }
.acc-fecha__txt b { font-size: 13.5px; }
.acc-fecha__txt span { font-size: 12.5px; color: var(--muted, #5F6673); line-height: 1.45; }
.acc-fecha__ctl { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.acc-fecha__ctl input {
  padding: 8px 11px; border: 1px solid var(--line, #E3E9ED); border-radius: 10px; font: inherit; font-size: 13px;
  background: var(--paper, #fff); color: var(--ink, #0E1620);
}

@media (max-width: 640px) {
  .acc-row { flex-wrap: wrap; gap: 6px 10px; }
  .acc-row__main { flex-basis: 100%; }
  .acc-row__fecha { min-width: 0; text-align: left; margin-left: auto; }
  .acc-filtros, .acc-filtros input, .acc-filtros select { width: 100%; min-width: 0; }
  .acc-seg { width: 100%; }
  .acc-seg button { flex: 1; }
  .perfil-correo { flex-wrap: wrap; }
}

/* ------------------------------ tema oscuro ------------------------------ */
html[data-theme="dark"] .correo-txt { color: #b6bdc9; }
html[data-theme="dark"] .correo-input span { background: rgba(129, 140, 248, .12); color: #c7cbe0; }
html[data-theme="dark"] .correo-link, html[data-theme="dark"] .pf-usar-codigo { color: #a5b4fc; }
html[data-theme="dark"] .perfil-correo { background: rgba(129, 140, 248, .1); border-color: rgba(129, 140, 248, .25); }
html[data-theme="dark"] .perfil-correo b { color: #f1f3f6; }
html[data-theme="dark"] .acc-seg button.is-on { background: #3a3d44; color: #e0e7ff; }
html[data-theme="dark"] .acc-tag--reg { color: #a5b4fc; }
html[data-theme="dark"] .acc-tag--rec { color: #86efac; }
html[data-theme="dark"] .acc-tag--cam { color: #67e8f9; }
html[data-theme="dark"] .acc-aviso, html[data-theme="dark"] .correo-dev { color: #fcd34d; }
html[data-theme="dark"] .correo-plazo { color: #c7d2fe; }
html[data-theme="dark"] .correo-plazo--vencido { color: #fecdd3; }
html[data-theme="dark"] .nu-ayuda { color: #e0e7ff; }
