/* ============================================================
   lopdp-arco.css — Estilos del módulo ARCO (LOPDP Ecuador)
   ------------------------------------------------------------
   Extraído de bloques <style> inline y atributos style="" de:
     - admin-arco.php        (login + panel admin)
     - derechos-arco.html    (formulario titular)
   Referenciado por: admin-arco.php, derechos-arco.html
   Cargar SIEMPRE DESPUÉS de bootstrap.min.css.
   ============================================================ */

/* === Login === */
/* NOTA: `body:has(.login-box)` aísla el layout a pantalla completa del
   login para NO interferir con el body del panel admin (que requiere
   scroll vertical normal). Selector soportado en navegadores modernos. */
body:has(.login-box) {
    background: #f5f5f5;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
    margin: 0;
}
.login-box {
    background: #fff;
    padding: 30px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    width: 350px;
    text-align: center;
}
.login-box h4 {
    color: #2a2d77;
    margin-bottom: 20px;
}

/* === Panel Admin === */
body {
    background: #f5f5f5;
    font-family: Arial, sans-serif;
}
.admin-container {
    max-width: 1100px;
    margin: 20px auto;
}
.admin-header {
    background: #2a2d77;
    color: #fff;
    padding: 20px 25px;
    border-radius: 8px 8px 0 0;
}
.admin-body {
    background: #fff;
    padding: 25px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
.stats {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
}
.stat-card {
    flex: 1;
    padding: 15px;
    border-radius: 6px;
    text-align: center;
    font-weight: bold;
}
.stat-pending { background: #fff3cd; color: #856404; }
.stat-resolved { background: #d4edda; color: #155724; }
.btn-resolve { background: #2a2d77; color: #fff; }
.btn-resolve:hover { background: #1a1d57; color: #fff; }

/* === Formulario ARCO === */
.arco-container {
    max-width: 800px;
    margin: 40px auto;
}
.arco-header {
    background: #2a2d77;
    color: #fff;
    padding: 25px;
    border-radius: 8px 8px 0 0;
    text-align: center;
}
.arco-body {
    background: #fff;
    padding: 30px;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}
/* === Fase 4: Tabs vanilla (sin Bootstrap JS) === */
/* Reemplazan .nav-pills / .tab-content / .tab-pane de Bootstrap */
.arco-tabs {
    display: flex;
    list-style: none;
    margin: 0 0 20px 0;
    padding: 0;
    border-bottom: 2px solid #e5e5e5;
}
.arco-tabs > li { flex: 1; }
.arco-tab-btn {
    display: block;
    padding: 10px 15px;
    text-align: center;
    color: #2a2d77;
    font-weight: 600;
    text-decoration: none;
    background: #f8f9fa;
    border: 1px solid #ddd;
    border-bottom: none;
    border-radius: 4px 4px 0 0;
    cursor: pointer;
}
.arco-tab-btn:hover { background: #eef0f8; color: #1a1d57; text-decoration: none; }
.arco-tab-btn.active { background-color: #2a2d77; color: #fff; border-color: #2a2d77; }
.arco-tab-pane { padding-top: 20px; display: none; }
.arco-tab-pane.active { display: block; }
.btn-arco { background: #2a2d77; color: #fff; font-weight: bold; }
.btn-arco:hover { background: #1a1d57; color: #fff; }
.arco-footer { text-align: center; padding: 20px; font-size: 12px; color: #666; }
.arco-footer a { color: #2a2d77; }
.result-box {
    background: #f9f9f9;
    border-left: 4px solid #2a2d77;
    padding: 15px;
    margin-top: 15px;
    border-radius: 4px;
    max-height: 400px;
    overflow-y: auto;
    display: none;
}
.result-box table { width: 100%; font-size: 13px; }
.result-box th { background: #2a2d77; color: #fff; padding: 6px; }
.result-box td { padding: 6px; border-bottom: 1px solid #ddd; }
/* OTP */
.otp-input {
    width: 50px !important;
    height: 60px;
    text-align: center;
    font-size: 28px;
    font-weight: bold;
    border: 2px solid #ccc;
    border-radius: 6px;
    margin: 0 5px;
    display: inline-block;
}
.otp-input:focus {
    border-color: #2a2d77;
    outline: none;
    box-shadow: 0 0 0 2px rgba(42,45,119,0.2);
}
#otpSection { display: none; }
#arcoForms { display: none; }
#tokenExpiry { font-size: 12px; color: #28a745; margin-bottom: 15px; }

/* === Utilidades y clases semánticas (Fase 1) === */
/* --- admin-arco.php --- */
.arco-login-btn { background: #2a2d77; border: none; }
.arco-flex-between { display: flex; justify-content: space-between; align-items: center; }
.arco-margin-0 { margin: 0; }
.arco-mt-5 { margin: 5px 0 0 0; }
.arco-text-right { text-align: right; }
.arco-session-info { color: #ccc; font-size: 11px; }
.arco-filter-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.arco-search-input { width: 250px; display: inline-block; }
.arco-btn-primary { background: #2a2d77; }
.arco-max-w-300 { max-width: 300px; }
.arco-font-12 { font-size: 12px; }
.arco-font-13 { font-size: 13px; }
.arco-margin-top-30 { margin-top: 30px; }
.arco-text-muted { color: #666; }
/* --- derechos-arco.html --- */
.arco-hint { font-size: 12px; color: #666; margin-top: 10px; }
.arco-expiry-warning { color: #d9534f; font-weight: bold; }
.arco-otp-inputs-wrap { text-align: center; margin: 20px 0; }
.arco-otp-actions { text-align: center; margin-bottom: 15px; }
.arco-token-bar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.arco-mb-15 { margin-bottom: 15px; }

/* === Swal Admin (Fase 2): estilos movidos del JS inline de admin-arco.php === */
.swal-estado { max-width: 80%; }
.swal-dpo { max-width: 80%; }
.swal-comentario { max-width: 80%; height: 80px; }

/* === Fase 3: estilos del HTML generado por JS en lopdp-arco.js === */
/* Sustituyen los 5 style="" que inyectaba el JS (líneas 42, 44, 64, 68, 226) */
.arco-msg-title { color: #2a2d77; }                                  /* h5 éxito */
.arco-summary-box { margin: 10px 0; padding: 10px; background: #e8f5e9; border-radius: 4px; } /* resumen consentimientos */
.arco-empty { color: #666; }                                        /* sin registros */
.arco-error { color: #d9534f; }                                     /* mensaje error */
.arco-msg-hint { font-size: 12px; color: #666; }                    /* nota rectificación */

/* Equivalente a .slideDown()/fade de jQuery: mostrar con animación */
.arco-reveal {
    display: block !important;
    animation: arcoFadeSlide 0.35s ease;
}
@keyframes arcoFadeSlide {
    from { opacity: 0; transform: translateY(-6px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* === Equivalencias Bootstrap (Fase 5) === */
/* Sustituyen las clases de Bootstrap usadas en admin-arco.php y
   derechos-arco.html tras eliminar el <link> de bootstrap.min.css.
   Estilos minimalistas (solo lo necesario) con colores de marca. */

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 6px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: center;
    text-decoration: none;
    vertical-align: middle;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease;
}
.btn-primary { background: #2a2d77; color: #fff; }
.btn-primary:hover { background: #1a1d57; color: #fff; }
.btn-danger { background: #d9534f; color: #fff; }
.btn-danger:hover { background: #c9302c; color: #fff; }
.btn-warning { background: #f0ad4e; color: #fff; }
.btn-warning:hover { background: #ec971f; color: #fff; }
.btn-success { background: #5cb85c; color: #fff; }
.btn-success:hover { background: #449d44; color: #fff; }
.btn-info { background: #5bc0de; color: #fff; }
.btn-info:hover { background: #31b0d5; color: #fff; }
.btn-default {
    background: #fff;
    color: #333;
    border: 1px solid #ccc;
}
.btn-default:hover { background: #e6e6e6; color: #333; }
.btn-block { display: block; width: 100%; }
.btn-sm { padding: 4px 8px; font-size: 12px; line-height: 1.5; }

/* --- Formularios --- */
.form-group { margin-bottom: 15px; }
.form-control {
    display: block;
    width: 100%;
    padding: 6px 12px;
    font-size: 14px;
    line-height: 1.5;
    color: #555;
    background: #fff;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box;
}
.form-control:focus {
    border-color: #2a2d77;
    outline: none;
    box-shadow: 0 0 0 2px rgba(42,45,119,0.15);
}
.input-sm { padding: 4px 8px; font-size: 12px; }

/* --- Tablas --- */
.table { width: 100%; border-collapse: collapse; }
.table-striped tbody tr:nth-child(odd) { background: #f9f9f9; }
.table-hover tbody tr:hover { background: #f5f5f5; }

/* --- Alertas --- */
.alert-danger {
    background: #f2dede;
    color: #a94442;
    border: 1px solid #ebccd1;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.alert-success {
    background: #dff0d8;
    color: #3c763d;
    border: 1px solid #d6e9c6;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}
.alert-warning {
    background: #fcf8e3;
    color: #8a6d3b;
    border: 1px solid #faebcc;
    padding: 15px;
    border-radius: 4px;
    margin-bottom: 15px;
}

/* --- Utilidades --- */
.text-center { text-align: center; }

/* ============================================================
   Fase 8: Accesibilidad, responsive y paginación
   ============================================================ */

/* Foco visible (accesibilidad WCAG 2.4.7) */
a:focus-visible,
button:focus-visible,
.btn:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid #2a2d77;
    outline-offset: 2px;
}

/* Etiqueta visualmente oculta pero disponible para lectores de pantalla */
.arco-visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* Contenedor de tabla desplazable horizontal en móviles (sin desborde) */
.table-responsive {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Contraste: texto oscuro sobre botón ámbar (blanco previo no cumplía WCAG AA) */
.btn-warning { color: #212529; }

/* === Paginación === */
.arco-pagination-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    margin-top: 15px;
}
.arco-pagination {
    display: flex;
    flex-wrap: wrap;
    list-style: none;
    gap: 4px;
    margin: 0;
    padding: 0;
}
.arco-pagination li a,
.arco-pagination li span {
    display: inline-block;
    min-width: 34px;
    padding: 6px 10px;
    text-align: center;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #2a2d77;
    text-decoration: none;
    background: #fff;
    font-weight: 600;
    box-sizing: border-box;
}
.arco-pagination li a:hover { background: #eef0f8; }
.arco-pagination li.arco-page-active a {
    background: #2a2d77;
    color: #fff;
    border-color: #2a2d77;
    cursor: default;
}
.arco-pagination li.arco-page-disabled span {
    color: #aaa;
    background: #f5f5f5;
    cursor: not-allowed;
}
.arco-pagination li.arco-page-ellipsis span { border: none; color: #666; }
.arco-pagination-info { margin: 0; font-size: 13px; color: #666; }

/* === Media queries responsive (Fase 8) === */
@media (max-width: 768px) {
    .admin-container { margin: 10px; }
    .admin-header, .admin-body { padding: 15px; border-radius: 8px; }
    .arco-flex-between { flex-direction: column; align-items: flex-start; gap: 10px; }
    .arco-text-right { text-align: left; }
    .stats { flex-direction: column; }
    .arco-filter-bar { flex-direction: column; align-items: stretch; gap: 10px; }
    .arco-search-input { width: 100%; }
    .arco-tabs > li { flex: 1 1 auto; }
    .arco-tab-btn { padding: 10px 8px; font-size: 13px; }
}

@media (max-width: 480px) {
    .admin-container { margin: 0; }
    .admin-header, .admin-body { padding: 12px; border-radius: 0; }
    .admin-body { box-shadow: none; }
    .login-box { width: calc(100% - 40px); max-width: 350px; padding: 20px; }
    .table { font-size: 12px; }
    .arco-flex-between h2 { font-size: 18px; }
    .arco-pagination li a,
    .arco-pagination li span { min-width: 30px; padding: 5px 8px; }
    .arco-tabs { flex-wrap: wrap; }
}

/* ============================================================
   Fase 9: Cumplimiento regulatorio LOPDP (consentimiento,
   finalidad, plazos legales y vencimiento)
   ============================================================ */

/* --- Formulario titular: finalidad del tratamiento --- */
.arco-finalidad {
    background: #eef0f8;
    border: 1px solid #d6d9f0;
    border-left: 4px solid #2a2d77;
    border-radius: 4px;
    padding: 12px 15px;
    margin-bottom: 15px;
    font-size: 13px;
    color: #333;
}
.arco-finalidad h5 {
    margin: 0 0 6px 0;
    color: #2a2d77;
    font-size: 14px;
}

/* --- Formulario titular: consentimiento informado y explícito --- */
.arco-consent {
    padding: 12px 15px;
    background: #f9f9f9;
    border: 1px solid #ddd;
    border-radius: 4px;
}
.arco-checkbox {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}
.arco-checkbox input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin-top: 2px;
    flex-shrink: 0;
    accent-color: #2a2d77;
}
.arco-checkbox a { color: #2a2d77; font-weight: 600; }

/* --- Formulario titular: plazo legal de respuesta --- */
.arco-plazo-info {
    font-size: 12.5px;
    color: #555;
    background: #fff8e6;
    border: 1px solid #f0dfa8;
    border-radius: 4px;
    padding: 8px 12px;
    margin: 0 0 12px 0;
}

/* --- Panel admin: badges de vencimiento (plazo 20 días hábiles) --- */
.arco-badge-vigente {
    background: #d4edda;
    color: #155724;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.arco-badge-proxima {
    background: #fff3cd;
    color: #856404;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.arco-badge-vencida {
    background: #f8d7da;
    color: #721c24;
    padding: 2px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    display: inline-block;
}
.arco-resolucion-motivo {
    display: block;
    color: #555;
    font-style: italic;
    max-width: 280px;
    white-space: normal;
}
