:root {
  --bg: #fbf7f1;
  --bg-soft: #f3ebe2;
  --surface: #ffffff;
  --text: #201b20;
  --muted: #746a71;
  --accent: #7c3aed;
  --accent-2: #f59e0b;
  --border: #eadfd5;
  --shadow: 0 22px 60px rgba(42, 28, 54, .13);
  --radius: 24px;
}

[data-theme="dark"] {
  --bg: #111018;
  --bg-soft: #181522;
  --surface: #1d1928;
  --text: #fff8f0;
  --muted: #c9bdc6;
  --accent: #a78bfa;
  --accent-2: #fbbf24;
  --border: #342d3d;
  --shadow: 0 24px 70px rgba(0,0,0,.38);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(124,58,237,.16), transparent 34rem),
    linear-gradient(180deg, var(--bg), var(--bg-soft));
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.65;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
.container { width: min(1160px, 92%); margin: 0 auto; }

.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--border);
}

.nav-inner {
  min-height: 76px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
}

.brand {
  font-family: Georgia, serif;
  font-size: 25px;
  font-weight: 600;
  letter-spacing: -.02em;
}

.brand span { color: var(--accent); }

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.nav-links a,
.icon-btn {
  border: 1px solid transparent;
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  padding: 9px 13px;
  cursor: pointer;
  font: inherit;
}

.nav-links a:hover,
.icon-btn:hover {
  border-color: var(--border);
  background: var(--surface);
}

.hero {
  padding: 84px 0 58px;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.08fr .92fr;
  align-items: center;
  gap: 42px;
}

.eyebrow {
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .12em;
  font-size: 13px;
  font-weight: 800;
}

h1, h2, h3 {
  line-height: 1.12;
  margin-top: 0;
}

.hero h1 {
  font-family: Georgia, serif;
  font-size: clamp(42px, 7vw, 76px);
  font-weight: 600;
  letter-spacing: -.045em;
  margin: 14px 0 18px;
}

.lead {
  color: var(--muted);
  font-size: 20px;
  max-width: 700px;
}

.hero-card {
  background: linear-gradient(145deg, var(--surface), color-mix(in srgb, var(--surface), var(--accent) 7%));
  border: 1px solid var(--border);
  border-radius: 32px;
  padding: 18px;
  box-shadow: var(--shadow);
}

.hero-card img {
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(0,0,0,.2);
}

.section { padding: 56px 0; }

.section h2 {
  font-family: Georgia, serif;
  font-size: clamp(30px, 4vw, 48px);
  font-weight: 600;
  letter-spacing: -.025em;
  margin-bottom: 24px;
}

.grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}

.grid.two { grid-template-columns: repeat(2, 1fr); }

.card {
  background: color-mix(in srgb, var(--surface) 94%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}

.story-card {
  display: flex;
  flex-direction: column;
}

.story-card img {
  border-radius: 18px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: var(--bg-soft);
}

.story-card h3 {
  font-family: Georgia, serif;
  font-size: 27px;
  font-weight: 600;
  margin: 16px 0 6px;
}

.muted { color: var(--muted); }

.pill {
  display: inline-flex;
  width: fit-content;
  padding: 5px 11px;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--muted);
  font-size: 13px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--accent), #5b21b6);
  color: #fff;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 16px 35px rgba(124,58,237,.28);
}

.btn.secondary {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

.btn.ghost {
  background: transparent;
  color: var(--text);
  border: 1px solid var(--border);
  box-shadow: none;
}

a.btn,
a.btn:link,
a.btn:visited,
a.btn:hover,
a.btn:active {
    color: #fff;
    text-decoration: none;
}

.actions {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 18px;
}

.form {
  display: grid;
  gap: 14px;
}

.input,
textarea,
select {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  padding: 13px 14px;
  font: inherit;
}

textarea { min-height: 130px; resize: vertical; }

.footer {
  padding: 36px 0;
  border-top: 1px solid var(--border);
  color: var(--muted);
}

.reader-layout {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 28px;
  align-items: start;
}

.chapter-list {
  position: sticky;
  top: 98px;
}

.chapter-item {
  display: block;
  width: 100%;
  margin-bottom: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  color: var(--text);
  text-align: left;
  cursor: pointer;
}

.chapter-item.read {
  border-color: #60a5fa;
  color: #2563eb;
}

.chapter-item.locked {
  opacity: .62;
}

.reader {
  font-size: var(--reader-size, 18px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: clamp(22px, 4vw, 38px);
  box-shadow: var(--shadow);
}

.reader p[data-body] {
  font-family: Georgia, serif;
  font-size: var(--reader-size, 18px);
  line-height: 1.9;
}

.progress {
  height: 10px;
  background: var(--border);
  border-radius: 999px;
  overflow: hidden;
}

.progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
}

.carousel {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(230px, 280px);
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.carousel .card { scroll-snap-align: start; }

.toast-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 9998;

    align-items: center;
    justify-content: center;
}

.toast {
    background: white;
    color: #222;

    width: calc(100% - 40px);
    max-width: 600px;

    padding: 25px;
    border-radius: 15px;

    text-align: center;
    font-size: 22px;
    font-weight: bold;

    box-shadow: 0 0 40px rgba(0, 0, 0, .5);
}

.admin-shell {
  display: grid;
  grid-template-columns: 260px 1fr;
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  background: var(--surface);
  border-right: 1px solid var(--border);
  padding: 22px;
}

.sidebar a {
  display: block;
  margin: 5px 0;
  padding: 11px 12px;
  border-radius: 14px;
}

.sidebar a:hover { background: var(--bg-soft); }

.admin-main { padding: 30px; }

.stats {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
}

.table-wrap { overflow-x: auto; }

.table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
}

.table th,
.table td {
  padding: 13px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.chart {
  height: 190px;
  display: flex;
  align-items: end;
  gap: 12px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 18px;
  background: linear-gradient(135deg, rgba(124,58,237,.18), rgba(245,158,11,.15));
}

.bar {
  flex: 1;
  background: var(--accent);
  border-radius: 10px 10px 0 0;
  opacity: .78;
}

.hide { display: none !important; }

@media (max-width: 860px) {
  .hero-grid,
  .reader-layout,
  .admin-shell,
  .grid,
  .grid.two,
  .stats {
    grid-template-columns: 1fr;
  }

  .nav-inner {
    align-items: flex-start;
    padding: 14px 0;
  }

  .chapter-list,
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }

  .admin-main { padding: 22px; }
}

/* =========================================================
   CAPA FINAL RESPONSIVA GLOBAL
   Mantiene el estilo visual existente y corrige TODAS las páginas:
   Home, Relatos, Relato, Checkout, Login, Registro, Recuperación,
   Blog, Biblioteca y Admin.
   ========================================================= */

/* Seguridad visual global */
html,
body {
  max-width: 100%;
  overflow-x: hidden;
}

img,
svg,
video,
canvas {
  max-width: 100%;
  height: auto;
}

/* Tablas, formularios y elementos que suelen romper móvil */
.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.table {
  width: 100%;
}

.input,
textarea,
select,
button {
  max-width: 100%;
}

.card,
.reader,
.hero-card {
  min-width: 0;
}

.mobile-menu-toggle {
  display: none;
}

/* Pantallas grandes */
@media (min-width: 1200px) {
  .container {
    width: min(1180px, 92%);
  }

  .grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* Laptops y tablets horizontales */
@media (max-width: 1180px) {
  .container {
    width: min(94%, 1040px);
  }

  .hero-grid {
    grid-template-columns: minmax(0, 1fr) minmax(300px, .76fr);
    gap: 30px;
  }

  .hero h1 {
    font-size: clamp(42px, 6vw, 66px);
  }

  .grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .stats {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .reader-layout {
    grid-template-columns: 290px minmax(0, 1fr);
    gap: 22px;
  }

  .admin-shell {
    grid-template-columns: 235px minmax(0, 1fr);
  }

  .admin-main {
    min-width: 0;
  }
}

/* Tablets verticales y móviles grandes */
@media (max-width: 920px) {
  .container {
    width: min(92%, 760px);
  }

  .nav {
    position: sticky;
  }

  .nav-inner {
    position: relative;
    min-height: 68px;
    padding: 12px 0;
    align-items: center;
  }

  .brand {
    font-size: 23px;
  }

  .mobile-menu-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .nav-links {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: calc(100% + 10px);
    z-index: 200;
    padding: 14px;
    border: 1px solid var(--border);
    border-radius: 22px;
    background: var(--surface);
    box-shadow: var(--shadow);
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a,
  .nav-links .icon-btn {
    width: 100%;
    min-height: 44px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    border-color: var(--border);
    background: color-mix(in srgb, var(--surface) 88%, var(--bg-soft));
    text-align: left;
  }

  .hero {
    padding: 46px 0 34px;
  }

  .hero-grid,
  .reader-layout,
  .admin-shell,
  .grid,
  .grid.two,
  .stats {
    grid-template-columns: 1fr;
  }

  .hero-card {
    width: min(100%, 470px);
    margin: 0 auto;
    transform: none;
  }

  .hero-card img {
    max-height: 560px;
    width: 100%;
    object-fit: cover;
  }

  .section {
    padding: 38px 0;
  }

  .chapter-list,
  .sidebar {
    position: relative;
    top: auto;
    height: auto;
  }

  .chapter-list {
    order: 1;
  }

  .reader {
    order: 2;
    padding: 24px;
  }

  .reader p[data-body] {
    font-size: var(--reader-size, 17px);
    line-height: 1.85;
  }

  .admin-shell {
    min-height: auto;
  }

  .sidebar {
    border-right: 0;
    border-bottom: 1px solid var(--border);
  }

  .sidebar a {
    display: inline-flex;
    margin: 4px 5px 4px 0;
  }

  .admin-main {
    padding: 22px;
  }

  .table {
    min-width: 720px;
  }

  .chart {
    height: 170px;
  }
}

/* Celulares */
@media (max-width: 680px) {
  body {
    font-size: 15.8px;
  }

  .container {
    width: 92%;
  }

  .nav-inner {
    gap: 10px;
  }

  .brand {
    font-size: 21px;
  }

  .mobile-menu-toggle {
    padding: 9px 11px;
    font-size: 14px;
  }

  .hero {
    padding-top: 38px;
  }

  .hero h1 {
    font-size: clamp(34px, 11vw, 46px);
    letter-spacing: -.035em;
  }

  .lead {
    font-size: 17px;
  }

  h1 {
    font-size: 34px;
  }

  .section h2,
  h2 {
    font-size: 30px;
  }

  .hero-card {
    padding: 12px;
    border-radius: 24px;
  }

  .hero-card img {
    max-height: 470px;
    border-radius: 18px;
  }

  .card {
    padding: 16px;
    border-radius: 20px;
  }

  .story-card {
    gap: 4px;
  }

  .story-card h3 {
    font-size: 24px;
  }

  .story-card img {
    width: 100%;
    max-height: 520px;
  }

  .actions {
    width: 100%;
    align-items: stretch;
  }

  .actions .btn,
  .actions .btn.secondary,
  .actions .btn.ghost {
    width: 100%;
  }

  .reader .actions .btn,
  .reader .actions .btn.secondary,
  .reader .actions .btn.ghost {
    width: 100%;
  }

  .btn,
  .icon-btn,
  .chapter-item {
    min-height: 44px;
  }

  .chapter-item {
    font-size: 15px;
    padding: 12px;
  }

  .reader {
    padding: 18px;
  }

  .reader h1 {
    font-size: 29px;
  }

  .reader p[data-body] {
    font-size: var(--reader-size, 16px);
  }

  .carousel {
    grid-auto-columns: minmax(240px, 86vw);
  }

  .form {
    gap: 12px;
  }

  .input,
  textarea,
  select {
    font-size: 16px;
    padding: 12px 13px;
  }

  .sidebar {
    padding: 18px;
  }

  .sidebar a,
  .sidebar .btn {
    width: 100%;
    justify-content: flex-start;
  }

  .admin-main {
    padding: 18px;
  }

  .stats .card h2 {
    font-size: 28px;
  }
}

/* Celulares pequeños */
@media (max-width: 430px) {
  .container {
    width: 91%;
  }

  .brand {
    font-size: 20px;
  }

  .mobile-menu-toggle {
    font-size: 13px;
    padding: 8px 10px;
  }

  .nav-links {
    border-radius: 18px;
  }

  .hero h1 {
    font-size: 32px;
  }

  .lead {
    font-size: 16px;
  }

  .section {
    padding: 32px 0;
  }

  .section h2,
  h2 {
    font-size: 28px;
  }

  main h1,
  .admin-main h1 {
    font-size: 31px;
  }

  .hero-card img {
    max-height: 405px;
  }

  .reader {
    padding: 15px;
  }

  .reader h1 {
    font-size: 26px;
  }

  .reader p[data-body] {
    line-height: 1.8;
  }

  .carousel {
    grid-auto-columns: 88vw;
  }

  .toast {
    left: 14px;
    right: 14px;
    max-width: none;
  }
}

/* Dispositivos touch */
@media (hover: none) {
  .btn,
  .icon-btn,
  .chapter-item,
  .nav-links a {
    min-height: 44px;
  }
}

.terms{
    display:flex;
    align-items:center;
    gap:8px;
    font-size:.95rem;
    margin:15px 0;
    padding-top: 15px;
}

.terms a{
    color:var(--primary);
    text-decoration:none;
    font-weight:600;
}

.terms a:hover{
    text-decoration:underline;
}

.modal{
    display:none;
    position:fixed;
    inset:0;
    background:rgba(0,0,0,.75);
    z-index:9999;
    justify-content:center;
    align-items:center;
    backdrop-filter:blur(4px);
}

.modal.show{
    display:flex;
}

.modal-content{
    width:min(900px,92vw);
    max-height:85vh;
    overflow:hidden;
    background:#fff;
    border-radius:18px;
    box-shadow:0 20px 70px rgba(0,0,0,.35);
    position:relative;
}

.modal-body{
    padding:30px;
    overflow-y:auto;
    max-height:75vh;
}

.modal-close{
    position:absolute;
    top:18px;
    right:18px;
    width:40px;
    height:40px;
    border:none;
    border-radius:50%;
    cursor:pointer;
    font-size:22px;
}

.TerminosHeader{
  margin: 20px;
}

a {
    color: #0066cc;              /* Azul */
    text-decoration: underline;  /* Subrayado */
    margin-right: 20px;          /* Espacio entre enlaces */
}

a:visited {
    color: #800080;              /* Morado cuando ya fue visitado */
}

a:hover {
    color: #004999;              /* Azul más oscuro al pasar el mouse */
}

a:active {
    color: #ff6600;              /* Mientras se hace clic */
}

.password-container{
    position:relative;
}

.password-container input{
    width:100%;
    padding-right:45px;
    box-sizing:border-box;
}

.toggle-password{

    position:absolute;

    top:50%;
    right:12px;

    transform:translateY(-50%);

    border:none;
    background:none;

    cursor:pointer;

    font-size:18px;

    padding:0;

}

.portadas-wrapper {
  display: flex;
  gap: 24px;
  align-items: flex-start;
  margin: 20px 0;
}

.portada-box {
  border: 1px solid #ccc;
  border-radius: 10px;
  padding: 16px;
  width: fit-content;
  text-align: center;
  background: #fff;
}

.portada-box h3 {
  margin-bottom: 12px;
  font-size: 16px;
}

.portada-box img {
  width: 204px;
  height: 308px;
  object-fit: cover;
  display: block;
  margin: 0 auto;
  border: 1px solid #ddd;
}

.btn-cambiar-imagen {
  margin-top: 14px;
  display: inline-block;
}

@media (max-width: 600px) {
  .portadas-wrapper {
    flex-direction: column;
    align-items: center;
  }
}

.modal-confirmacion{
    display:none;
    position:fixed;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.45);
    z-index:99999;
}

.modal-contenido{
    position:absolute;
    left:50%;
    top:50%;
    transform:translate(-50%,-50%);
    background:#fff;
    padding:25px;
    border-radius:8px;
    width:380px;
    box-shadow:0 0 20px rgba(0,0,0,.4);
    text-align:center;
}

.modal-mensaje{
    font-size:18px;
    margin-bottom:25px;
}

.modal-botones button{
    margin:0 8px;
    padding:8px 22px;
    cursor:pointer;
}

.search-box{
    margin-bottom:20px;
}

.search-box input{
    width:100%;
    max-width:500px;
    padding:12px 16px;
    font-size:16px;
    border:1px solid #ccc;
    border-radius:8px;
    outline:none;
}

.search-box input:focus{
    border-color:#4b8cff;
}

mark{
    background:#ffe95b;
    color:inherit;
    padding:0 2px;
    border-radius:3px;
}

.lang-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 4px 6px;
}

.lang-btn img {
    width: 28px;
    height: 20px;
    object-fit: cover;
    border-radius: 2px;
    display: block;
}

.lang-btn:hover img {
    transform: scale(1.1);
}

/* CARD DE SERIE - MODO CLARO */
.story-card.serie-card {
    position: relative !important;

    /* Más visible que antes */
    background: linear-gradient(
        145deg,
        #e4ddff 0%,
        #dce8ff 100%
    ) !important;

    border: 1px solid #b9aef0 !important;

    transition:
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.story-card.serie-card:hover {
    transform: translateY(-3px);

    box-shadow:
        0 8px 22px rgba(73, 60, 150, 0.22);
}


/* ETIQUETA SERIE */
.story-card.serie-card .serie-badge {
    position: absolute !important;

    top: 10px !important;
    right: 10px !important;

    left: auto !important;
    bottom: auto !important;

    width: auto !important;
    height: auto !important;

    display: inline-block !important;

    background: #5542b8;
    color: #ffffff;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 1px;

    line-height: 1;

    padding: 7px 11px;

    border-radius: 20px;

    z-index: 20;

    box-shadow:
        0 2px 8px rgba(0, 0, 0, 0.28);

    pointer-events: none;
}

[data-theme="dark"] .story-card.serie-card {
    background: linear-gradient(
        145deg,
        #25213d 0%,
        #1d2940 100%
    ) !important;

    border-color: #514b7d !important;
}

[data-theme="dark"] .story-card.serie-card .serie-badge {
    background: #8c7cff;
}

/* =========================
   MODAL CONTACTO
========================= */

/* ====================================================== */
/* FONDO DEL MODAL                                        */
/* ====================================================== */

.contact-modal {
    position: fixed;
    inset: 0;

    display: none;

    justify-content: center;
    align-items: center;

    padding: 20px;

    background: rgba(0, 0, 0, 0.60);

    overflow-y: auto;

    z-index: 9999;

    box-sizing: border-box;
}


/* ====================================================== */
/* CONTENIDO PRINCIPAL                                    */
/* ====================================================== */

.contact-modal-content {
    position: relative;

    width: 95%;
    max-width: 1050px;

    max-height: calc(100vh - 40px);

    overflow-y: auto;

    background: #ffffff;

    border-radius: 14px;

    padding: 22px 26px 20px 26px;

    box-sizing: border-box;

    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}


/* ====================================================== */
/* BOTÓN CERRAR                                           */
/* ====================================================== */

.contact-close {
    position: absolute;

    top: 10px;
    right: 15px;

    border: none;
    background: transparent;

    font-size: 30px;
    line-height: 30px;

    cursor: pointer;

    z-index: 10;
}


/* ====================================================== */
/* ENCABEZADO                                             */
/* ====================================================== */

.contact-header-row {
    display: flex;

    align-items: flex-end;
    justify-content: space-between;

    gap: 30px;

    margin-bottom: 16px;

    padding-right: 35px;
}


.contact-header-row .TerminosHeader {
    margin: 0;
}


.contact-key-field {
    display: flex;
    align-items: center;

    gap: 10px;
}


.contact-key-field label {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


.contact-key-field input {
    width: 100px;

    padding: 7px 9px;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #f2f2f2;

    font-size: 14px;

    box-sizing: border-box;
}


/* ====================================================== */
/* DATOS DEL SOLICITANTE                                  */
/* ====================================================== */

.contact-user-container {
    display: grid;

    grid-template-columns:
        minmax(220px, 2fr)
        minmax(140px, 1fr)
        minmax(250px, 2fr);

    gap: 14px;

    padding: 12px;

    margin-bottom: 14px;

    border: 1px solid #ddd;
    border-radius: 9px;

    background: rgba(0, 0, 0, 0.02);
}


.contact-user-field {
    display: flex;
    flex-direction: column;

    gap: 4px;

    min-width: 0;
}


.contact-user-field label {
    font-size: 13px;
    font-weight: 600;
}


.contact-user-field input {
    width: 100%;

    height: 34px;

    padding: 6px 9px;

    border: 1px solid #ccc;
    border-radius: 6px;

    font-size: 14px;

    box-sizing: border-box;
}


.contact-user-field input[readonly] {
    background: #f2f2f2;
    color: #555;
}


/* ====================================================== */
/* TIPO DE SOLICITUD                                      */
/* ====================================================== */

.contact-type-section {
    display: flex;

    align-items: center;

    gap: 18px;

    margin-bottom: 14px;

    padding: 10px 12px;

    border: 1px solid #ddd;
    border-radius: 9px;
}


.contact-section-label {
    flex-shrink: 0;

    font-size: 14px;
    font-weight: 600;
}


.contact-options {
    display: flex;

    flex: 1;

    align-items: center;
    justify-content: space-between;

    gap: 15px;
}


.contact-option {
    display: flex;

    align-items: center;

    gap: 6px;

    white-space: nowrap;

    cursor: pointer;

    font-size: 14px;
}


.contact-option input {
    margin: 0;

    cursor: pointer;
}


/* ====================================================== */
/* SOLICITUD Y RESPUESTA                                  */
/* ====================================================== */

.contact-text-row {
    display: grid;

    grid-template-columns: 1fr 1fr;

    gap: 15px;

    margin-bottom: 14px;
}


.contact-text-container {
    position: relative;

    display: flex;
    flex-direction: column;

    min-width: 0;
}


.contact-text-container label {
    margin-bottom: 5px;

    font-size: 13px;
    font-weight: 600;
}


.contact-text-container textarea {
    width: 100%;

    height: 105px;
    min-height: 105px;
    max-height: 105px;

    resize: none;

    padding: 9px 10px;

    border: 1px solid #ccc;
    border-radius: 7px;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.35;

    box-sizing: border-box;
}


.contact-counter {
    margin-top: 3px;

    text-align: right;

    font-size: 11px;
    color: #777;
}


/* ====================================================== */
/* INFORMACIÓN DE ATENCIÓN                                */
/* ====================================================== */

.contact-attention-container {
    display: grid;

    grid-template-columns:
        minmax(180px, 1.2fr)
        minmax(180px, 1fr)
        minmax(180px, 1fr);

    align-items: end;

    gap: 18px;

    padding: 12px;

    margin-bottom: 12px;

    border: 1px solid #ddd;
    border-radius: 9px;

    background: rgba(0, 0, 0, 0.02);
}


.contact-resolved {
    display: flex;

    align-items: center;

    gap: 8px;

    min-height: 34px;

    font-size: 14px;
    font-weight: 600;

    cursor: pointer;
}


.contact-resolved input {
    width: 18px;
    height: 18px;

    margin: 0;

    cursor: pointer;
}


.contact-date-field {
    display: flex;
    flex-direction: column;

    gap: 4px;
}


.contact-date-field label {
    font-size: 13px;
    font-weight: 600;
}


.contact-date-field input {
    width: 100%;
    height: 34px;

    padding: 5px 8px;

    border: 1px solid #ccc;
    border-radius: 6px;

    font-size: 14px;

    box-sizing: border-box;
}


.contact-date-field input[readonly] {
    background: #f2f2f2;
}


/* ====================================================== */
/* MENSAJES DEL MODAL                                     */
/* ====================================================== */


.contact-message {
    display: block;

    width: 100%;

    margin: 10px 0;
    padding: 10px 12px;

    border-radius: 7px;

    font-size: 14px;
    font-weight: 600;

    box-sizing: border-box;
}


/* Si no hay mensaje, no ocupa espacio */

.contact-message:empty {
    display: none;
}


/* ERROR */

.contact-message.error {
    color: #b42318;

    background-color: #fef3f2;

    border: 1px solid #fecdca;
}


/* CORRECTO */

.contact-message.success {
    color: #067647;

    background-color: #ecfdf3;

    border: 1px solid #abefc6;
}


/* ADVERTENCIA */

.contact-message.warning {
    color: #854d0e;

    background-color: #fefce8;

    border: 1px solid #fde68a;
}

/* ====================================================== */
/* BOTONES                                                */
/* ====================================================== */

.contact-buttons {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 10px;
}


.contact-buttons button {
    min-width: 125px;

    padding: 9px 18px;

    border-radius: 7px;

    cursor: pointer;
}


/* ====================================================== */
/* TABLET                                                 */
/* ====================================================== */

@media (max-width: 850px) {

    .contact-modal-content {
        width: 97%;
    }


    .contact-user-container {
        grid-template-columns: 1fr 1fr;
    }


    .contact-user-field:last-child {
        grid-column: 1 / -1;
    }


    .contact-options {
        flex-wrap: wrap;
        justify-content: flex-start;
    }


    .contact-attention-container {
        grid-template-columns: 1fr 1fr;
    }


    .contact-resolved {
        grid-column: 1 / -1;
    }

}


/* ====================================================== */
/* CELULAR                                                */
/* ====================================================== */

@media (max-width: 600px) {

    .contact-modal {
        padding: 10px;
        align-items: flex-start;
    }


    .contact-modal-content {
        width: 100%;

        max-height: calc(100vh - 20px);

        padding: 18px 15px;
    }


    .contact-header-row {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;

        padding-right: 30px;
    }


    .contact-key-field {
        width: 100%;

        justify-content: space-between;
    }


    .contact-user-container {
        grid-template-columns: 1fr;
    }


    .contact-user-field:last-child {
        grid-column: auto;
    }


    .contact-type-section {
        align-items: flex-start;
        flex-direction: column;

        gap: 8px;
    }


    .contact-options {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }


    .contact-text-row {
        grid-template-columns: 1fr;
    }


    .contact-attention-container {
        grid-template-columns: 1fr;
    }


    .contact-resolved {
        grid-column: auto;
    }


    .contact-buttons {
        flex-direction: column-reverse;
    }


    .contact-buttons button {
        width: 100%;
    }

}

/* ====================================================== */
/* MODAL CONTACTO SIMPLE                                  */
/* ====================================================== */

.contact-modal-simple {
    max-width: 1000px;
    width: 95%;

    padding: 20px 26px;

    max-height: calc(100vh - 40px);
}


/* Encabezado más compacto */

.contact-modal-simple .contact-header-row {
    margin-bottom: 14px;
}


/* Título */

.contact-modal-simple .TerminosHeader {
    margin: 0;
}


/* Motivo y opciones en un solo renglón */

.contact-modal-simple .contact-type-section {
    display: flex;

    align-items: center;

    gap: 20px;

    padding: 12px 14px;

    margin-bottom: 14px;

    border: 1px solid #ddd;
    border-radius: 9px;
}


.contact-modal-simple .contact-section-label {
    flex-shrink: 0;

    font-size: 14px;
    font-weight: 600;

    white-space: nowrap;
}


.contact-modal-simple .contact-options {
    display: flex;

    flex: 1;

    align-items: center;
    justify-content: space-between;

    gap: 18px;
}


.contact-modal-simple .contact-option {
    display: flex;

    align-items: center;

    gap: 6px;

    font-size: 14px;

    white-space: nowrap;

    cursor: pointer;
}


.contact-modal-simple .contact-option input {
    margin: 0;

    cursor: pointer;
}


/* ====================================================== */
/* TEXTAREA MÁS BAJO                                      */
/* ====================================================== */

.contact-text-simple {
    margin-bottom: 8px;
}


.contact-text-simple label {
    display: block;

    margin-bottom: 5px;

    font-size: 13px;
    font-weight: 600;
}


.contact-text-simple textarea {
    width: 100%;

    height: 115px;
    min-height: 115px;
    max-height: 115px;

    resize: none;

    padding: 10px;

    border: 1px solid #ccc;
    border-radius: 7px;

    box-sizing: border-box;

    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
}


/* Contador */

.contact-text-simple .contact-counter {
    margin-top: 3px;

    text-align: right;

    font-size: 11px;
    color: #777;
}


/* ====================================================== */
/* BOTONES                                                */
/* ====================================================== */

.contact-modal-simple .contact-buttons {
    display: flex;

    justify-content: flex-end;

    gap: 10px;

    margin-top: 10px;
}


/* ====================================================== */
/* TABLET / PANTALLAS PEQUEÑAS                            */
/* ====================================================== */

@media (max-width: 850px) {

    .contact-modal-simple .contact-type-section {
        flex-direction: column;
        align-items: flex-start;

        gap: 10px;
    }


    .contact-modal-simple .contact-options {
        width: 100%;

        flex-wrap: wrap;

        justify-content: flex-start;
    }

}


/* ====================================================== */
/* CELULAR                                                */
/* ====================================================== */

@media (max-width: 600px) {

    .contact-modal-simple {
        width: 100%;

        padding: 18px 15px;
    }


    .contact-modal-simple .contact-section-label {
        white-space: normal;
    }


    .contact-modal-simple .contact-options {
        flex-direction: column;

        align-items: flex-start;

        gap: 8px;
    }


    .contact-text-simple textarea {
        height: 130px;
        min-height: 130px;
        max-height: 130px;
    }


    .contact-modal-simple .contact-buttons {
        flex-direction: column-reverse;
    }


    .contact-modal-simple .contact-buttons button {
        width: 100%;
    }

}

/* ====================================================== */
/* FILTROS DE SOLICITUDES DE CONTACTO                     */
/* ====================================================== */

.contact-admin-filters {
    display: grid;

    grid-template-columns:
        minmax(180px, 1fr)
        minmax(430px, 2.5fr)
        minmax(230px, 1.3fr);

    gap: 15px;

    margin: 15px 0 20px 0;
}


/* Cada sección */

.contact-filter-section {
    display: flex;

    align-items: center;

    gap: 10px;

    padding: 12px 14px;

    border: 1px solid #ddd;
    border-radius: 9px;

    background: rgba(0, 0, 0, 0.02);

    box-sizing: border-box;
}


/* Etiquetas */

.contact-filter-section > label,
.contact-filter-label {
    font-size: 13px;
    font-weight: 600;

    white-space: nowrap;
}


/* Combobox */

.contact-filter-section select {
    flex: 1;

    min-width: 0;

    height: 35px;

    padding: 5px 9px;

    border: 1px solid #ccc;
    border-radius: 6px;

    background: #fff;

    font-size: 13px;
}


/* Sección de checkboxes */

.contact-filter-types {
    justify-content: flex-start;
}


/* Cada checkbox */

.contact-filter-check {
    display: flex;

    align-items: center;

    gap: 5px;

    font-size: 13px;
    font-weight: normal !important;

    white-space: nowrap;

    cursor: pointer;
}


.contact-filter-check input {
    width: 16px;
    height: 16px;

    margin: 0;

    cursor: pointer;
}


/* Tablet */

@media (max-width: 1000px) {

    .contact-admin-filters {
        grid-template-columns: 1fr;
    }

}


/* Celular */

@media (max-width: 600px) {

    .contact-filter-section {
        align-items: flex-start;
        flex-direction: column;
    }

    .contact-filter-types {
        flex-direction: column;
    }

}

/*Código de confirmación*/

.confirmation-section {
    display: none;
    margin-top: 15px;
    padding: 18px;
    border: 1px solid #ddd;
    border-radius: 10px;
    background: rgba(255,255,255,0.04);
}

.confirmation-section.visible {
    display: block;
}

.confirmation-title {
    margin: 0 0 6px 0;
    font-size: 18px;
}

.confirmation-text {
    margin: 0 0 14px 0;
    font-size: 14px;
    color: #777;
    line-height: 1.5;
}

.confirmation-code {
    width: 100%;
    max-width: 260px;
    text-align: center;
    font-size: 28px;
    font-weight: 600;
    letter-spacing: 10px;
    padding: 12px 8px;
}

.confirmation-actions {
    margin-top: 12px;
}

.resend-code {
    font-size: 13px;
    cursor: pointer;
}


.mensaje-modal{
    display:none;
    position:fixed;
    z-index:99999;
    left:0;
    top:0;
    width:100%;
    height:100%;
    background:rgba(0,0,0,.60);
    align-items:center;
    justify-content:center;
    padding:20px;
}

.mensaje-modal-content{
    width:100%;
    max-width:430px;
    background:#fff;
    border-radius:14px;
    padding:30px;
    text-align:center;
    box-shadow:0 20px 60px rgba(0,0,0,.30);
}

.mensaje-modal-texto{
    font-size:17px;
    color:#333;
    line-height:1.6;
    margin-bottom:25px;
}

.mensaje-modal-botones{
    display:flex;
    justify-content:center;
    gap:10px;
    flex-wrap:wrap;
}

.mensaje-modal-botones button{
    min-width:100px;
}