/* Temas de la home y resto del sitio (gestionado por data-theme en <html>) */

:root {
    /* Tema claro (por defecto) */
    --bg: #ffffff;
    --bg-soft: #f7f7f7;
    --bg-card: #ffffff;
    --text: #1a1a1a;
    --text-soft: #555555;
    --text-muted: #888888;
    --border: #e0e0e0;
    --accent: #d4af37;
    --accent-strong: #b8941f;
    --link: #1b3a5b;
    --success: #0d8050;
    --error: #d9534f;
}

html[data-theme="dark"] {
    --bg: #0d1b2a;
    --bg-soft: #16263a;
    --bg-card: #16263a;
    --text: #f1f1f1;
    --text-soft: #b8b8b8;
    --text-muted: #888888;
    --border: #2a3f5a;
    --accent: #ffd45a;
    --accent-strong: #ffc107;
    --link: #88c8ff;
    --success: #2ecc71;
    --error: #ff6b6b;
    color-scheme: dark;
}

html[data-theme="high-contrast"] {
    --bg: #000000;
    --bg-soft: #000000;
    --bg-card: #000000;
    --text: #ffffff;
    --text-soft: #ffff00;
    --text-muted: #ffff00;
    --border: #ffffff;
    --accent: #ffff00;
    --accent-strong: #ffff00;
    --link: #00ffff;
    --success: #00ff00;
    --error: #ff5555;
    color-scheme: dark;
}

html[data-theme="high-contrast"] * {
    /* Forzar contraste máximo en todos los elementos */
    text-shadow: none !important;
    box-shadow: none !important;
}

html[data-theme="high-contrast"] a,
html[data-theme="high-contrast"] button {
    text-decoration: underline;
}

html[data-theme="high-contrast"] button,
html[data-theme="high-contrast"] .btn,
html[data-theme="high-contrast"] .flr-cta {
    border: 2px solid #ffff00 !important;
    background: #000 !important;
    color: #ffff00 !important;
}

/* Aplicación de las variables al sitio (donde se usan los colores antiguos) */
body { background: var(--bg); color: var(--text); }
.flr-section--soft { background: var(--bg-soft); }
.card, .cc-card { background: var(--bg-card); border-color: var(--border); color: var(--text); }
a { color: var(--link); }
.flr-section__lead, .field__help, .panel-header__subtitle { color: var(--text-soft); }

/* Widget de tema/idioma flotante en la home */
.flr-prefs {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 100;
    display: flex;
    gap: 8px;
    align-items: center;
    flex-wrap: wrap;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 6px 8px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.flr-prefs__group { display: flex; gap: 4px; align-items: center; }
.flr-prefs__label { font-size: 12px; color: var(--text-soft); padding: 0 4px; }
.flr-prefs__btn,
.flr-prefs__select {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    color: var(--text);
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-family: inherit;
}
.flr-prefs__btn:hover { background: var(--accent); color: #000; }
.flr-prefs__btn[aria-pressed="true"] {
    background: var(--accent);
    color: #000;
    font-weight: 700;
}

@media (max-width: 700px) {
    .flr-prefs {
        position: relative;
        top: auto; right: auto;
        margin: 0 auto var(--space-3, 16px);
        justify-content: center;
        width: fit-content;
    }
}
