/* =========================================================
   ETERNAWORLD · CAPA GLOBAL DE TEMA CLARO
   ---------------------------------------------------------
   Fuente de verdad: users.ui_theme (MariaDB)
        ↓ eternaworld_ui_theme()      (inc/bootstrap.php)
        ↓ <html data-theme="light|dark">
   Esta hoja se carga siempre la última desde
   eternaworld_stylesheets(). Solo actúa con data-theme="light";
   en modo oscuro no cambia nada.
   Corrige componentes compartidos (components.css / admin.css)
   que tenían colores oscuros fijos.
========================================================= */

/* ---------- Botones y enlaces genéricos ---------- */
html[data-theme="light"] .secondary-button {
    color: #5b21b6;
    background: rgba(124, 60, 255, .07);
    border-color: rgba(124, 60, 255, .28);
}
html[data-theme="light"] .back-link:hover {
    color: #151922;
    background: rgba(15, 23, 42, .04);
}

/* ---------- Progreso / racha ---------- */
html[data-theme="light"] .progress-orb {
    background: conic-gradient(var(--ok) calc(var(--progress) * 1%), rgba(15, 23, 42, .08) 0);
}
html[data-theme="light"] .progress-orb > div { background: #ffffff; }
html[data-theme="light"] :is(.progress-track, .mini-track) { background: rgba(15, 23, 42, .08); }
html[data-theme="light"] .week-day.today { background: rgba(15, 23, 42, .04); }

/* ---------- Hábitos ---------- */
html[data-theme="light"] .habit-card { background: rgba(255, 255, 255, .92); }
html[data-theme="light"] .habit-card.completed {
    background: linear-gradient(90deg, rgba(21, 155, 112, .08), rgba(255, 255, 255, .95));
}
html[data-theme="light"] .habit-card.completed .habit-toggle { color: #ffffff; }

/* ---------- Formularios de hábitos (habits/create, habits/edit) ---------- */
html[data-theme="light"] :is(.habit-form-group input, .habit-form-group textarea) {
    background: #ffffff;
    color: var(--text);
}
html[data-theme="light"] :is(.habit-form-group input, .habit-form-group textarea):hover { border-color: #b9c2d0; }
html[data-theme="light"] :is(.habit-form-group input, .habit-form-group textarea):focus { background: #ffffff; }
html[data-theme="light"] .habit-form-alert.error { color: #9b1c33; }
html[data-theme="light"] .habit-suggestions { background: #f7f8fc; }
html[data-theme="light"] .habit-suggestion { color: #3c4455; background: #ffffff; }
html[data-theme="light"] .habit-suggestion:hover { color: #5b21b6; }

/* ---------- Chat / avatar ---------- */
html[data-theme="light"] .message.user .avatar { background: #e6eaf1; color: #3c4455; }

/* ---------- Modal de hitos ---------- */
html[data-theme="light"] .milestone-backdrop { background: rgba(15, 23, 42, .45); }
html[data-theme="light"] .milestone-card {
    color: var(--text);
    background:
        radial-gradient(circle at 50% -15%, rgba(180, 54, 255, .12), transparent 42%),
        linear-gradient(180deg, #ffffff, #f7f8fc);
    box-shadow: 0 30px 90px rgba(15, 23, 42, .20);
}
html[data-theme="light"] .milestone-sparkle { color: #9d35e8; }
html[data-theme="light"] .milestone-eterna { background: #f7f8fc; }
html[data-theme="light"] .milestone-eterna p { color: #3c4455; }

/* ---------- Toast ---------- */
html[data-theme="light"] .toast { background: #ffffff; }

/* ---------- Tarjetas de autenticación / privacidad ---------- */
html[data-theme="light"] .auth-card input { background: #ffffff; }
html[data-theme="light"] .privacy-card {
    color: var(--text);
    background: linear-gradient(155deg, #ffffff, #f7f8fc);
}

/* ---------- Admin ---------- */
html[data-theme="light"] :is(
    .admin-table input, .admin-table textarea, .admin-table select,
    .badge-admin-form input, .badge-admin-form textarea, .badge-admin-form select,
    .badge-assign-grid select
) { background: #ffffff; color: var(--text); }
html[data-theme="light"] :is(.badge-admin-form, .badge-admin-card) { background: #f7f8fc; }

/* ---------- Centro de seguridad ---------- */
html[data-theme="light"] body { color: var(--text); }
html[data-theme="light"] body.security-auth-body { background: var(--bg); color: var(--text); }
html[data-theme="light"] .security-auth-card { border-color: var(--line); background: #ffffff; box-shadow: var(--shadow); }
html[data-theme="light"] .security-auth-badge { color: #5b21b6; }
html[data-theme="light"] .security-auth-card p { color: var(--muted); }
html[data-theme="light"] .security-auth-card label { color: #3c4455; }
html[data-theme="light"] .security-auth-card input { border-color: #d0d7e2; background: #ffffff; color: var(--text); }
html[data-theme="light"] .security-config-error { color: #9b1c33; }
html[data-theme="light"] .security-table { background: #ffffff; }
html[data-theme="light"] .security-table th { background: #f5f6fb; }
html[data-theme="light"] .status-ok { color: #0f8a68; }
html[data-theme="light"] .status-bad { color: #c2334d; }
html[data-theme="light"] .eterna-plus-pill { background: #f5f6fb; color: #3c4455; }
html[data-theme="light"] .eterna-plus-pill.active { color: #0f7d5f; }
