/* =====================================================================
 * Contenido legal (términos, privacidad, artículos prohibidos) y su modal.
 * Independiente del resto: lo usan condiciones.php, privacidad.php, login.html,
 * registrar.php, la portada y el panel del cliente (usr/). Prefijo tc-.
 * ===================================================================== */
:root {
    --tc-azul: #0b1f4a; --tc-primario: #2563eb; --tc-naranja: #f58626; --tc-naranja-2: #ff9f43;
    --tc-texto: #1f2a44; --tc-gris: #64748b; --tc-borde: #e5e9f0; --tc-fondo: #f6f8fc; --tc-rojo: #dc2626;
}

/* Secciones numeradas */
.tc-sec { background: #fff; border: 1px solid var(--tc-borde); border-radius: 18px; padding: 1.5rem 1.6rem; margin-bottom: 1rem; scroll-margin-top: 96px; }
.tc-sec-cab { display: flex; align-items: center; gap: .75rem; margin-bottom: .9rem; }
.tc-sec-cab h2 { font-size: 1.15rem; font-weight: 800; margin: 0; color: var(--tc-texto); letter-spacing: -.01em; }
.tc-sec-cab > i { width: 40px; height: 40px; flex: none; border-radius: 12px; background: #eef3ff; color: var(--tc-primario); display: inline-flex; align-items: center; justify-content: center; font-size: 1.05rem; }
.tc-sec-n { font-size: .72rem; font-weight: 800; color: var(--tc-naranja); letter-spacing: .06em; font-variant-numeric: tabular-nums; order: 3; margin-left: auto; background: #fff4ea; border-radius: 999px; padding: .2rem .55rem; }
.tc-sec-txt { color: #475569; font-size: .96rem; line-height: 1.7; }
.tc-sec-txt p { margin: 0 0 .75rem; }
.tc-sec-txt p:last-child { margin-bottom: 0; }
.tc-sec-txt b { color: var(--tc-texto); }
.tc-sec-txt a { color: var(--tc-primario); font-weight: 600; }
.tc-sec-txt ul { margin: 0; padding-left: 1.2rem; }
.tc-sec-txt li { margin-bottom: .4rem; }
.tc-aviso { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412 !important; border-radius: 12px; padding: .75rem .9rem; }
.tc-aviso b { color: #9a3412 !important; }

/* Pestañas sin JS (radio + label) */
.tc-tabs { margin-top: 1rem; display: flex; flex-wrap: wrap; gap: .4rem; }
.tc-tabs > input { position: absolute; opacity: 0; pointer-events: none; }
.tc-tabs > label { display: inline-flex; align-items: center; gap: .45rem; font-weight: 700; font-size: .88rem; color: var(--tc-gris); background: var(--tc-fondo); border: 1px solid var(--tc-borde); border-radius: 999px; padding: .45rem .95rem; cursor: pointer; transition: background .15s, color .15s; user-select: none; }
.tc-tabs > label:hover { color: var(--tc-texto); }
.tc-tabs > input:focus-visible + label { outline: 3px solid rgba(37,99,235,.3); outline-offset: 2px; }
.tc-tab-panel { display: none; width: 100%; margin-top: .6rem; }
.tc-tabs > input:nth-of-type(1):checked ~ .tc-tab-panel:nth-of-type(1),
.tc-tabs > input:nth-of-type(2):checked ~ .tc-tab-panel:nth-of-type(2),
.tc-tabs > input:nth-of-type(3):checked ~ .tc-tab-panel:nth-of-type(3),
.tc-tabs > input:nth-of-type(4):checked ~ .tc-tab-panel:nth-of-type(4),
.tc-tabs > input:nth-of-type(5):checked ~ .tc-tab-panel:nth-of-type(5),
.tc-tabs > input:nth-of-type(6):checked ~ .tc-tab-panel:nth-of-type(6) { display: block; }
.tc-tabs > input:checked + label { background: var(--tc-azul); border-color: var(--tc-azul); color: #fff; }

.tc-orig-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: .8rem; }
.tc-orig { border: 1px solid var(--tc-borde); border-radius: 14px; padding: 1rem 1.05rem; background: #fff; }
.tc-orig-cab { display: flex; align-items: center; gap: .5rem; margin-bottom: .65rem; padding-bottom: .6rem; border-bottom: 1px dashed var(--tc-borde); }
.tc-orig-cab .flag-icon { width: 1.4em; border-radius: 3px; box-shadow: 0 0 0 1px rgba(0,0,0,.06); }
.tc-orig-cab b { color: var(--tc-texto); }
.tc-orig-cab small { color: var(--tc-gris); margin-left: auto; font-weight: 600; }
.tc-x { list-style: none; padding: 0 !important; margin: 0; display: grid; gap: .32rem; font-size: .88rem; }
.tc-x li { position: relative; padding-left: 1.35rem; margin: 0 !important; line-height: 1.45; color: #475569; }
.tc-x li::before { content: '\f00d'; font-family: FontAwesome; position: absolute; left: 0; top: .05em; color: #ef4444; font-size: .8rem; }
.tc-x li.fuerte { color: var(--tc-texto); font-weight: 700; }
.tc-libre { display: flex; gap: .55rem; color: #166534 !important; background: #f0fdf4; border-radius: 10px; padding: .65rem .75rem; font-size: .88rem; margin: 0 !important; }
.tc-libre i { color: #22c55e; margin-top: .2rem; }
.tc-orig-ok { display: flex; gap: .5rem; font-size: .84rem; color: #1e3a5f; background: #eff6ff; border-radius: 10px; padding: .6rem .7rem; margin: .7rem 0 0 !important; }
.tc-orig-ok i { color: var(--tc-primario); margin-top: .2rem; }
.tc-orig-ok + .tc-orig-ok { margin-top: .4rem !important; }
.tc-orig-extra { font-size: .84rem; background: var(--tc-fondo); border-radius: 10px; padding: .6rem .7rem; margin: .7rem 0 0 !important; }
.tc-orig-extra i { color: var(--tc-primario); margin-right: .25rem; }
.tc-nota { font-size: .85rem; color: var(--tc-gris) !important; margin: .8rem 0 0 !important; }
.tc-nota i { color: var(--tc-primario); margin-right: .3rem; }

/* =====================================================================
 * Modal (js/terminos.js) — <dialog> nativo, no necesita Bootstrap
 * ===================================================================== */
.tc-modal { width: min(860px, calc(100% - 24px)); max-height: min(88vh, 900px); padding: 0; border: 0; border-radius: 22px; background: var(--tc-fondo);
    box-shadow: 0 40px 80px -30px rgba(11,31,74,.55); color: var(--tc-texto); font-family: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif; overflow: hidden; }
.tc-modal[open] { display: flex; flex-direction: column; animation: tc-entra .22s ease-out; }
.tc-modal::backdrop { background: rgba(7,22,52,.55); backdrop-filter: blur(3px); }
@keyframes tc-entra { from { opacity: 0; transform: translateY(14px) scale(.98); } to { opacity: 1; transform: none; } }
.tc-modal-cab { position: relative; color: #fff; padding: 1.3rem 1.5rem 1rem; background: radial-gradient(600px 240px at 90% -40%, #2a5bd7 0%, transparent 70%), linear-gradient(150deg, var(--tc-azul), #12306e); }
.tc-modal-cab small { display: block; text-transform: uppercase; letter-spacing: .1em; font-weight: 800; font-size: .7rem; color: var(--tc-naranja-2); margin-bottom: .2rem; }
.tc-modal-cab h3 { font-size: 1.35rem; font-weight: 800; margin: 0; }
.tc-modal-cab p { margin: .35rem 0 0; color: rgba(255,255,255,.7); font-size: .85rem; }
.tc-cerrar { position: absolute; top: .9rem; right: .9rem; width: 38px; height: 38px; border-radius: 12px; border: 0; background: rgba(255,255,255,.14); color: #fff; font-size: 1.1rem; cursor: pointer; }
.tc-cerrar:hover { background: rgba(255,255,255,.25); }
.tc-indice { display: flex; gap: .35rem; overflow-x: auto; padding: .9rem 0 0; margin-bottom: -.2rem; scrollbar-width: thin; }
.tc-indice button { flex: none; border: 0; cursor: pointer; font-family: inherit; font-size: .78rem; font-weight: 700; color: rgba(255,255,255,.78); background: rgba(255,255,255,.1); border-radius: 999px; padding: .32rem .75rem; text-decoration: none; white-space: nowrap; }
.tc-indice button:hover { background: rgba(255,255,255,.2); color: #fff; }
.tc-modal-cuerpo { overflow-y: auto; padding: 1.2rem 1.5rem; flex: 1; overscroll-behavior: contain; }
.tc-modal-cuerpo .tc-sec { scroll-margin-top: 12px; }
.tc-modal-pie { display: flex; align-items: center; gap: .6rem; flex-wrap: wrap; padding: .9rem 1.5rem; background: #fff; border-top: 1px solid var(--tc-borde); }
.tc-modal-pie span { color: var(--tc-gris); font-size: .82rem; margin-right: auto; }
.tc-btn { display: inline-flex; align-items: center; justify-content: center; gap: .45rem; font-weight: 700; font-size: .92rem; border-radius: 12px; padding: .65rem 1.15rem; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .15s, box-shadow .15s; font-family: inherit; }
.tc-btn:hover { transform: translateY(-1px); }
.tc-btn-primario { background: linear-gradient(135deg, var(--tc-naranja), var(--tc-naranja-2)); color: #fff; box-shadow: 0 8px 22px -8px rgba(245,134,38,.7); }
.tc-btn-primario:hover { color: #fff; }
.tc-btn-claro { background: #fff; border-color: var(--tc-borde); color: var(--tc-texto); }
.tc-btn-claro:hover { color: var(--tc-texto); }
.tc-cargando { padding: 3rem 1rem; text-align: center; color: var(--tc-gris); }
.tc-cargando i { font-size: 1.6rem; color: var(--tc-primario); margin-bottom: .6rem; display: block; }
.tc-prog { position: absolute; left: 0; bottom: 0; height: 3px; background: linear-gradient(90deg, var(--tc-naranja), var(--tc-naranja-2)); width: 0; transition: width .1s; }
body.tc-sin-scroll { overflow: hidden; }

/* Enlace "leer los términos" dentro de formularios */
.tc-link { background: none; border: 0; padding: 0; color: var(--tc-primario); font-weight: 700; cursor: pointer; font: inherit; text-decoration: underline; text-underline-offset: 2px; }
.tc-link:hover { color: #1d4ed8; }

@media (max-width: 575px) {
    .tc-modal { width: 100%; max-width: 100%; max-height: 92vh; margin: auto 0 0; border-radius: 22px 22px 0 0; }
    .tc-modal-cab, .tc-modal-cuerpo, .tc-modal-pie { padding-left: 1rem; padding-right: 1rem; }
    .tc-indice { padding-left: 0; padding-right: 0; }
    .tc-sec { padding: 1.15rem 1.1rem; }
    .tc-modal-pie span { width: 100%; }
    .tc-modal-pie .tc-btn { flex: 1; }
}
@media (prefers-reduced-motion: reduce) { .tc-modal[open] { animation: none; } .tc-btn:hover { transform: none; } }
@media print {
    .tc-sec { break-inside: avoid; border-color: #ccc; }
    .tc-tabs > label, .tc-tabs > input { display: none; }
    .tc-tab-panel { display: block !important; }
}

/* Mismo aspecto para un modal de Bootstrap (portada: artículos prohibidos) */
.tc-bs-modal { border: 0; border-radius: 22px; overflow: hidden; background: var(--tc-fondo); box-shadow: 0 40px 80px -30px rgba(11,31,74,.55); }
.tc-bs-modal .tc-modal-cab { padding-right: 3.5rem; }
.tc-bs-modal .tc-tabs { margin-top: 0; }
.modal-backdrop.show { opacity: .55; }

/* Hojas de estilo viejas (registro, panel) que pintan <nav>, h3 o botones */
.tc-modal nav.tc-indice { background: none !important; height: auto !important; min-height: 0 !important; box-shadow: none !important; position: static !important; width: auto !important; }
.tc-modal h3, .tc-modal h2 { font-family: inherit; }
/* Las plantillas viejas dibujan sus propios radios (label::before/::after): acá no */
.tc-tabs > input[type=radio] { position: absolute !important; left: -9999px !important; opacity: 0 !important; width: 1px !important; height: 1px !important; }
.tc-tabs > input[type=radio] + label { padding: .45rem .95rem !important; margin: 0 !important; height: auto !important; line-height: 1.4 !important; }
.tc-tabs > input[type=radio] + label::before, .tc-tabs > input[type=radio] + label::after { display: none !important; content: none !important; }
