/* =============================================
   PuffCase — tyc-popup.css
   Popup de Términos y Condiciones
   ============================================= */

/* ── Overlay ─────────────────────────────────── */
#tyc-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
    opacity: 0;
    transition: opacity 0.3s ease;
}
#tyc-overlay.tyc-visible  { opacity: 1; }
#tyc-overlay.tyc-saliendo { opacity: 0; }

/* ── Modal ───────────────────────────────────── */
.tyc-modal {
    background: var(--card-bg, #1a1535);
    border: 1px solid var(--purple-border, #3b2d6a);
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.7), 0 0 0 1px rgba(124,58,237,0.2);
    transform: translateY(24px) scale(0.97);
    transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
#tyc-overlay.tyc-visible .tyc-modal {
    transform: translateY(0) scale(1);
}

/* ── Cabecera ────────────────────────────────── */
.tyc-modal-header {
    padding: 28px 28px 20px;
    text-align: center;
    border-bottom: 1px solid var(--purple-border, #3b2d6a);
    background: linear-gradient(180deg, rgba(124,58,237,0.1) 0%, transparent 100%);
    flex-shrink: 0;
}
.tyc-modal-icon {
    font-size: 2.4rem;
    margin-bottom: 10px;
    line-height: 1;
}
.tyc-modal-titulo {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--white, #fff);
    margin: 0 0 8px;
}
.tyc-modal-sub {
    font-size: 0.88rem;
    color: var(--gray-light, #b3aac8);
    margin: 0;
    line-height: 1.5;
}

/* ── Cuerpo scrollable ───────────────────────── */
.tyc-modal-body {
    flex: 1;
    overflow-y: auto;
    padding: 24px 28px;
    scroll-behavior: smooth;
}
.tyc-modal-body:focus { outline: none; }

/* Scrollbar estilizada */
.tyc-modal-body::-webkit-scrollbar { width: 6px; }
.tyc-modal-body::-webkit-scrollbar-track { background: transparent; }
.tyc-modal-body::-webkit-scrollbar-thumb {
    background: var(--purple-border, #3b2d6a);
    border-radius: 3px;
}
.tyc-modal-body::-webkit-scrollbar-thumb:hover {
    background: var(--purple-accent, #7c3aed);
}

/* Contenido de los términos */
.tyc-modal-body h3 {
    font-family: 'Rajdhani', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    color: var(--purple-glow, #c084fc);
    margin: 20px 0 8px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    font-size: 0.82rem;
}
.tyc-modal-body h3:first-child { margin-top: 0; }
.tyc-modal-body p {
    font-size: 0.88rem;
    color: var(--gray-light, #b3aac8);
    line-height: 1.75;
    margin: 0 0 4px;
}
.tyc-last-update {
    margin-top: 24px;
    padding-top: 16px;
    border-top: 1px solid var(--purple-border, #3b2d6a);
    font-size: 0.78rem;
    color: var(--gray-mid, #7a7090);
    text-align: center;
}

/* Indicador de scroll */
.tyc-modal-body::after {
    content: '';
    display: block;
    height: 1px;
}

/* ── Footer ──────────────────────────────────── */
.tyc-modal-footer {
    padding: 20px 28px 24px;
    border-top: 1px solid var(--purple-border, #3b2d6a);
    background: rgba(0,0,0,0.2);
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex-shrink: 0;
}

/* Checkbox personalizado */
.tyc-checkbox-label {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    cursor: pointer;
    font-size: 0.88rem;
    color: var(--gray-light, #b3aac8);
    line-height: 1.5;
    user-select: none;
}
.tyc-checkbox-label input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}
.tyc-checkbox-custom {
    flex-shrink: 0;
    width: 20px;
    height: 20px;
    border: 2px solid var(--purple-border, #3b2d6a);
    border-radius: 6px;
    background: rgba(255,255,255,0.04);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s, background 0.2s;
    margin-top: 1px;
}
.tyc-checkbox-label input:checked + .tyc-checkbox-custom {
    background: var(--purple-accent, #7c3aed);
    border-color: var(--purple-accent, #7c3aed);
}
.tyc-checkbox-label input:checked + .tyc-checkbox-custom::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    transform: rotate(45deg) translateY(-1px);
}
.tyc-checkbox-label:hover .tyc-checkbox-custom {
    border-color: var(--purple-accent, #7c3aed);
}
.tyc-checkbox-label strong { color: var(--white, #fff); }

/* Botón aceptar */
.tyc-btn-aceptar {
    width: 100%;
    padding: 14px;
    border: none;
    border-radius: 12px;
    font-family: 'Rajdhani', 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.25s;
    background: linear-gradient(135deg, var(--purple-accent, #7c3aed), #5b21b6);
    color: #fff;
    box-shadow: 0 4px 20px rgba(124,58,237,0.4);
}
.tyc-btn-aceptar:disabled {
    background: rgba(255,255,255,0.07);
    color: var(--gray-mid, #7a7090);
    box-shadow: none;
    cursor: not-allowed;
}
.tyc-btn-aceptar:not(:disabled):hover {
    background: linear-gradient(135deg, #8b5cf6, #6d28d9);
    box-shadow: 0 6px 28px rgba(124,58,237,0.55);
    transform: translateY(-1px);
}
.tyc-btn-aceptar:not(:disabled):active {
    transform: translateY(0);
}

/* ── Responsive ──────────────────────────────── */
@media (max-width: 480px) {
    .tyc-modal-header { padding: 22px 18px 16px; }
    .tyc-modal-body   { padding: 18px; }
    .tyc-modal-footer { padding: 16px 18px 20px; }
    .tyc-modal-titulo { font-size: 1.35rem; }
}
