/* ===========================================================================
   Elia: gai iluna (tema oscuro) de las páginas propias. Lo común (cabecera, footer, Bootstrap/MDB) está en elh_theme.css.
   Solo se aplica con html.theme-dark (js/elh_theme.js). Colores: variables --dk-* y --elh-* de elh_theme.css.
   =========================================================================== */

/* --- Ventanas emergentes y glosarios desactivados (custom_styles.css) --- */
html.theme-dark .popup { background-color: var(--dk-surface); color: var(--elh-ink); box-shadow: 0 3px 12px rgba(0, 0, 0, .5); }
html.theme-dark .deactivated, html.theme-dark #glossary_list div#glossary_items:hover { background-color: var(--dk-raised); color: var(--elh-muted); }

/* --- Portada (landing_page.css) --- */
html.theme-dark #page-top #prices .nav-tabs .nav-link.active { background: var(--dk-surface) !important; color: var(--dk-accent) !important; border-color: var(--dk-surface) !important; }

/* --- Itzultzailea (translate.html) --- */
html.theme-dark .elia-langbar, html.theme-dark #translate_text .elia-langbar .glossary-box,
html.theme-dark .elia-langbar #glossary_info_div, html.theme-dark .elia-share,
html.theme-dark .elia-share__copy, html.theme-dark .elia-voice__option span { background: var(--dk-surface) !important; }
html.theme-dark #left_box ~ .col-lg-6 > [data-autoresize-height] { background-color: var(--dk-soft) !important; }
html.theme-dark .elia-langbar #glossary_list > .border-bottom:hover, html.theme-dark .elia-voice__option:hover span,
html.theme-dark .elia-share__close:hover, html.theme-dark .elia-share__copy:hover, html.theme-dark .elia-share__copy:focus-visible { background: var(--dk-raised) !important; }
html.theme-dark .elia-share__link input { background: var(--dk-input); }
html.theme-dark .elia-share__social a:hover, html.theme-dark .elia-share__social a:focus-visible { background: var(--dk-raised); }
html.theme-dark .elia-voice__option input:checked + span { background: var(--elh-blue-soft) !important; }
html.theme-dark .elia-play { background: var(--dk-fill); }
html.theme-dark .elia-play:hover { background: var(--dk-fill-dark); }
html.theme-dark #output_text_overlay.elia-toast { background: #eef1f8; color: #10131c; }
html.theme-dark .form-div { color: var(--elh-ink); }
html.theme-dark #translate-tabs .nav-link:hover { background: rgba(169, 188, 255, .08); }

/* --- Tablas y menús (custom_styles.css les pone texto marrón oscuro con !important) --- */
html.theme-dark td, html.theme-dark th, html.theme-dark .dropdown-item { color: var(--elh-ink) !important; }
html.theme-dark .border-bottom { border-bottom-color: var(--elh-line) !important; }
html.theme-dark .alert-elhuyar { background-color: var(--dk-fill); border-color: var(--dk-fill); }
html.theme-dark .alert-elhuyar-dark { background-color: var(--dk-raised); border-color: var(--elh-line); color: var(--elh-ink); }

/* --- Aplikazioak (info/applications.html) --- */
html.theme-dark .app-card { background: var(--dk-surface); border-color: var(--elh-line); }
html.theme-dark .app-card:hover, html.theme-dark .app-card:focus-within { background-color: var(--dk-raised); box-shadow: 0 .75rem 1.5rem rgba(0, 0, 0, .4); }

/* --- Bloga (blog/blog.html: variables --bl-*) --- */
html.theme-dark {
	--bl-blue: var(--dk-accent); --bl-teal: var(--elh-teal); --bl-teal-dark: var(--dk-teal); --bl-ink: #eef1f8; --bl-text: #d5dbe8;
	--bl-muted: var(--elh-muted); --bl-line: var(--elh-line); --bl-soft: var(--dk-soft);
}
html.theme-dark .bl-sheet { background: var(--dk-surface); border-color: var(--elh-line); box-shadow: none; }
html.theme-dark .bl-media { background: var(--dk-soft); }
html.theme-dark .bl-btn { background: var(--dk-raised); }
html.theme-dark .bl-skip { background: var(--dk-fill); }
html.theme-dark .bl-media-empty { background: linear-gradient(135deg, #142a7a 0%, #006664 100%); }

/* --- Dokumentuak, glosarioak eta posteditzea (documents.css, glossaries.css, postedition.css: variables --dm-* y --pe-*) --- */
html.theme-dark {
	--dm-teal-dark: var(--dk-teal); --dm-teal-soft: rgba(95, 224, 213, .1); --dm-blue: var(--dk-accent); --dm-blue-soft: var(--elh-blue-soft);
	--dm-text: var(--elh-ink); --dm-muted: var(--elh-muted); --dm-border: var(--elh-line-soft); --dm-border-strong: var(--elh-line);
	--dm-surface: var(--dk-surface); --dm-surface-alt: var(--dk-soft); --dm-danger: #ff8f9c; --dm-danger-soft: #3b1f26;
	--dm-warning: #f3d58c; --dm-warning-soft: #3a3220;
	--pe-teal-dark: var(--dk-teal); --pe-teal-soft: rgba(95, 224, 213, .1); --pe-blue: var(--dk-accent); --pe-blue-soft: var(--elh-blue-soft);
	--pe-text: var(--elh-ink); --pe-muted: var(--elh-muted); --pe-border: var(--elh-line-soft); --pe-border-strong: var(--elh-line);
	--pe-surface: var(--dk-surface); --pe-surface-alt: var(--dk-soft); --pe-warning: #ff8f9c; --pe-warning-soft: #3b1f26;
	--pe-amber: #f3cf7a; --pe-ok: #74e6ac; --pe-ok-soft: #153a29;
}
html.theme-dark .dm-btn-primary:hover:not(:disabled), html.theme-dark .pe-btn-primary:hover:not(:disabled) { background: #00807e; border-color: #00807e; }
html.theme-dark .dm-btn-solid-danger, html.theme-dark .pe-btn-solid-danger { background: #c0392b; border-color: #c0392b; }
html.theme-dark .dm-btn-ghost, html.theme-dark .pe-btn-ghost { color: var(--elh-ink) !important; }
html.theme-dark .dm-alert-success, html.theme-dark tr.is-new .gl-state { background: #153a29; color: #9df0c3; }
html.theme-dark .dm-selectbar, html.theme-dark .pe-toolbar { background: rgba(29, 34, 51, .97); }
html.theme-dark .dm-badge, html.theme-dark .gl-format, html.theme-dark .gl-sample th { background: var(--dk-raised); color: var(--elh-ink); }
html.theme-dark .dm-badge-glossary { background: rgba(95, 224, 213, .12); }
html.theme-dark .dm-badge-glossary-none, html.theme-dark .dm-dropzone-box, html.theme-dark .gl-option, html.theme-dark .gl-sample { background: var(--dk-surface); }
html.theme-dark .dm-toast, html.theme-dark .gl-savebar { background: #eef1f8; color: #10131c; }
html.theme-dark .gl-savebar .dm-btn-ghost { border-color: rgba(16, 19, 28, .35); color: #10131c !important; }
html.theme-dark .gl-intro, html.theme-dark .gl-field label, html.theme-dark .gl-howto ul { color: var(--elh-muted); }
html.theme-dark .gl-drop { background: var(--dk-soft); border-color: var(--elh-line); color: var(--elh-muted); }
html.theme-dark .gl-progress, html.theme-dark .pe-progress { background: var(--dk-raised); }
html.theme-dark .pe-message.is-warning { background: #3a3220; color: #f3d58c; }
html.theme-dark .pe-row:hover { background: var(--dk-raised); }
html.theme-dark .pe-source mark, html.theme-dark .pe-target mark { background: #6b5a14; color: #fff; }
html.theme-dark .pe-to-top { background: var(--dk-fill); }

/* --- Dokumentua igotzea (documents/drag_drop.html), dokumentuaren itzulpena (documents/translate.html) --- */
html.theme-dark .up-drop { background: var(--dk-soft); color: var(--elh-ink); }
html.theme-dark .up-drop-title { color: var(--dk-accent); }
html.theme-dark .up-drop-features li { background: var(--dk-surface); color: var(--elh-ink); }
html.theme-dark .up-format { background: var(--dk-raised); color: var(--elh-ink); }
html.theme-dark .up-formats .up-formats-body { background: var(--dk-surface); border-color: var(--elh-line); }
html.theme-dark .up-formats > summary { color: var(--dk-teal); }
html.theme-dark .up-format-group-name { color: var(--elh-ink); }
html.theme-dark .up-bar { background: var(--dk-raised); }
html.theme-dark .dt-option { background: var(--dk-surface); }

/* --- Profila eta ordainketa (profile/index.html, documents/payment_step1.html) --- */
html.theme-dark .md-form label.active { background: transparent; }
html.theme-dark .choose_type:not(.active):hover { background: var(--dk-raised) !important; }
/* md-form: campo de línea, como en claro (la regla general de inputs, más específica, los pintaba como bloques) */
html.theme-dark .md-form input.form-control { background-color: transparent !important; border-bottom-color: var(--elh-line); color: var(--elh-ink); }
html.theme-dark .md-form input.form-control:focus { border-bottom-color: var(--dk-teal); box-shadow: 0 1px 0 0 var(--dk-teal); }
html.theme-dark .md-form label { color: var(--elh-muted); }
/* Pestañas Pertsona / Enpresa */
html.theme-dark .choose_type.active { background-color: var(--dk-fill) !important; color: #fff !important; }
html.theme-dark .choose_type:not(.active) { background-color: var(--dk-surface) !important; color: var(--dk-accent) !important; }
/* Pasos de la compra (payment_base.html, stepper de MDB) */
html.theme-dark ul.stepper li a .label { color: var(--elh-muted); }
html.theme-dark ul.stepper li.active a .label, html.theme-dark ul.stepper li.completed a .label { color: var(--elh-ink); }
html.theme-dark ul.stepper li a .circle { background: var(--dk-raised); color: var(--elh-ink) !important; }
html.theme-dark ul.stepper li.active a .circle, html.theme-dark ul.stepper li.completed a .circle { background-color: #00807e !important; color: #fff !important; }
html.theme-dark .stepper-horizontal li:not(:first-child)::before, html.theme-dark .stepper-horizontal li:not(:last-child)::after { background-color: var(--elh-line); }
/* Resumen y carrito (payment_step2.html) */
html.theme-dark .list-group-item.grey.lighten-4 { background-color: var(--dk-raised) !important; color: var(--elh-ink); }
html.theme-dark #payment_container img[src*="Stripe_Logo"] { filter: brightness(0) invert(1); opacity: .85; }
html.theme-dark .badge.badge-light { background-color: var(--dk-raised) !important; color: var(--elh-ink) !important; }

/* --- Itzultzailea: hiztegia eta oharrak --- */
html.theme-dark .dict-link, html.theme-dark .remark, html.theme-dark .interactive:hover { color: var(--dk-accent); }

/* Portada, formatos de documento: los colores de cada tipo, más claros sobre fondo oscuro */
html:where(.theme-dark) .lp-fmt__icon { background: color-mix(in srgb, var(--c) 22%, transparent); color: color-mix(in srgb, var(--c) 45%, #fff); }
/* Portada, Ibilbidea: el anillo de cada año, del color del fondo de la banda (en claro es blanco) */
html:where(.theme-dark) .lp-timeline__year { box-shadow: 0 0 0 5px #1d2233; }
/* Portada, banda de Orai: mantiene sus colores también en oscuro (botón blanco sobre su degradado) */
html:where(.theme-dark) .lp-orai__cta { background-color: #fff !important; color: #0045e7 !important; }
html:where(.theme-dark) .lp-orai__cta:hover, html:where(.theme-dark) .lp-orai__cta:focus { background-color: #eef2ff !important; }
