/* =========================================================
   Cotizador conversacional (una pregunta a la vez)
   Capa de presentación sobre los campos del plugin.
   ========================================================= */

/* ── Hero ── */
.dic-conv-page {
    min-height: 100vh;
    background:
        linear-gradient(180deg, rgba(1,14,94,.86) 0%, rgba(1,28,120,.66) 45%, rgba(1,18,86,.74) 100%),
        url('https://decisioninformada.agenciacroma.com.ar/wp-content/uploads/2026/06/di-generated/di-hero-cotizador.png') center center / cover no-repeat;
}
.dic-conv-hero {
    text-align: center;
    padding: 64px 0 40px;
}
.dic-conv-hero .di-tag,
.dic-conv-hero .di-tag-light {
    color: #fff; background: rgba(255,255,255,.16);
    border: 1px solid rgba(255,255,255,.28);
    -webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.dic-conv-h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 600; letter-spacing: -.02em;
    color: #fff; margin: 14px 0 10px;
    text-shadow: 0 2px 20px rgba(0,0,0,.25);
}
.dic-conv-lead {
    font-size: 1.05rem; color: rgba(255,255,255,.85);
    max-width: 540px; margin: 0 auto; line-height: 1.6;
}

/* ── Shell + card ── */
.dic-conv-shell { padding: 0 0 88px; }
.dic-conv {
    position: relative;
    max-width: 660px; margin: 0 auto;
    background: #fff;
    border: 1px solid #EAECF5;
    border-radius: 28px 28px 28px 52px;
    box-shadow: 0 30px 70px rgba(1, 14, 94, .12);
    padding: 26px 30px 30px;
}

/* ── Topbar: asistente + progreso ── */
.dic-conv-topbar { margin-bottom: 22px; }
.dic-conv-assistant {
    display: flex; align-items: center; gap: 12px;
    margin-bottom: 16px;
}
.dic-conv-avatar {
    width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0;
    background: var(--di-primary-light); color: var(--di-primary);
    display: inline-flex; align-items: center; justify-content: center;
}
.dic-conv-assistant-txt { line-height: 1.25; margin-right: auto; }
.dic-conv-assistant-txt strong { display: block; font-size: .95rem; color: var(--di-gray-800); }
.dic-conv-assistant-txt small { font-size: .78rem; color: var(--di-gray-400); }
.dic-form-card-free {
    align-self: flex-start;
    font-size: .68rem; font-weight: 700; letter-spacing: .08em;
    color: var(--di-success); background: rgba(16,185,129,.12);
    padding: 5px 11px; border-radius: 999px;
}
.dic-conv-progress { display: flex; align-items: center; gap: 12px; }
.dic-conv-bar {
    flex: 1; height: 7px; border-radius: 999px;
    background: #EEF0F8; overflow: hidden;
}
.dic-conv-bar-fill {
    display: block; height: 100%; width: 0;
    background: var(--di-primary); border-radius: 999px;
    transition: width .35s cubic-bezier(.4,0,.2,1);
}
.dic-conv-count {
    font-size: .78rem; font-weight: 600; color: var(--di-gray-400);
    font-variant-numeric: tabular-nums; white-space: nowrap;
}

/* ── Viewport / preguntas ── */
.dic-conv-form .dic-step { display: contents; }
.dic-conv-viewport { position: relative; min-height: 168px; }

/* Base (sin FOUC): sólo la pregunta activa, que ya viene marcada desde el server */
.dic-conv .dic-q:not(.is-active) { display: none; }
.dic-conv .dic-q.is-active { display: block; }
/* Modo activo: !important para ganarle al display inline del plugin (salario/cónyuge) */
.dic-conv-ready .dic-q:not(.is-active) { display: none !important; }
.dic-conv-ready .dic-q.is-active { display: block !important; }
/* Fallback: si el JS conversacional falla, se muestran todas las preguntas */
.dic-conv-fallback .dic-q { display: block !important; }

.dic-q.dic-anim-in-right { animation: dic-q-in .34s cubic-bezier(.2,.7,.2,1); }
.dic-q.dic-anim-in-left  { animation: dic-q-in-back .34s cubic-bezier(.2,.7,.2,1); }
@keyframes dic-q-in      { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
@keyframes dic-q-in-back { from { opacity: 0; transform: translateY(-16px); } to { opacity: 1; transform: none; } }

.dic-q-title {
    font-size: clamp(1.5rem, 3.4vw, 2.15rem);
    font-weight: 600; line-height: 1.25; letter-spacing: -.015em;
    color: var(--di-gray-800); margin: 0 0 20px;
    text-wrap: balance;
}
.dic-q-opt { font-weight: 500; font-size: .8em; color: var(--di-gray-400); }

.dic-q .dic-field-group { margin: 0; }
.dic-q .dic-label {
    display: block; font-size: .85rem; font-weight: 600;
    color: var(--di-gray-600); margin-bottom: 8px;
}
.dic-required { color: var(--di-danger); }
.dic-hint { font-size: .82rem; color: var(--di-gray-400); margin: 8px 0 0; }
.dic-field-error {
    display: block; min-height: 1.1em;
    font-size: .82rem; font-weight: 600; color: var(--di-danger); margin-top: 7px;
}

/* Inputs */
.dic-conv .dic-input,
.dic-conv .dic-select {
    width: 100%; box-sizing: border-box;
    font-family: inherit; font-size: 1.05rem; color: var(--di-gray-800);
    padding: 15px 16px;
    border: 1.5px solid #DDE1EF; border-radius: 14px;
    background: #fff; outline: none;
    transition: border-color .18s, box-shadow .18s;
}
.dic-conv .dic-select {
    appearance: none; -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat; background-position: right 14px center;
    padding-right: 42px; cursor: pointer;
}
.dic-conv .dic-input:focus,
.dic-conv .dic-select:focus {
    border-color: var(--di-primary);
    box-shadow: 0 0 0 4px rgba(1,44,184,.12);
}
.dic-conv .dic-input.has-error,
.dic-conv .dic-select.has-error { border-color: var(--di-danger); box-shadow: 0 0 0 4px rgba(239,68,68,.12); }

.dic-input-prefix-wrap { position: relative; display: flex; align-items: center; }
.dic-input-prefix {
    position: absolute; left: 16px; font-size: 1.05rem;
    font-weight: 600; color: var(--di-gray-400); pointer-events: none;
}
.dic-input-prefix-wrap .dic-input { padding-left: 32px; }

/* Opciones tipo botón (radios) */
.dic-fieldset-plain { border: none; margin: 0; padding: 0; }
.dic-optbtns { display: flex; gap: 12px; flex-wrap: wrap; }
.dic-optbtn {
    flex: 1; min-width: 120px; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    padding: 16px 18px; text-align: center;
    font-size: 1rem; font-weight: 600; color: var(--di-gray-600);
    border: 1.5px solid #DDE1EF; border-radius: 14px;
    background: #fff; transition: border-color .16s, background .16s, color .16s;
}
.dic-optbtn input { position: absolute; opacity: 0; width: 0; height: 0; }
.dic-optbtn:hover { border-color: var(--di-primary); }
.dic-optbtn:has(input:checked) {
    border-color: var(--di-primary); color: var(--di-primary);
    background: var(--di-primary-light);
}
.dic-optbtn:has(input:focus-visible) { box-shadow: 0 0 0 4px rgba(1,44,184,.12); }

/* Checkbox como tarjeta */
.dic-checkcard {
    display: flex; align-items: flex-start; gap: 12px; cursor: pointer;
    padding: 16px 18px; border: 1.5px solid #DDE1EF; border-radius: 14px;
    font-size: .96rem; line-height: 1.45; color: var(--di-gray-800);
    transition: border-color .16s, background .16s;
}
.dic-checkcard:hover { border-color: var(--di-primary); }
.dic-checkcard:has(input:checked) { border-color: var(--di-primary); background: var(--di-primary-light); }
.dic-checkcard input { margin-top: 2px; width: 20px; height: 20px; accent-color: var(--di-primary); flex-shrink: 0; }
.dic-checkcard a { color: var(--di-primary); font-weight: 600; text-decoration: underline; }

/* Hijos */
#dic-children-container { display: flex; flex-direction: column; gap: 10px; margin-bottom: 12px; }
.dic-child-row { display: flex; align-items: center; gap: 10px; }
.dic-child-row label { font-size: .9rem; font-weight: 600; color: var(--di-gray-600); min-width: 62px; }
.dic-child-row .dic-input { flex: 1; padding: 11px 14px; font-size: 1rem; }
.dic-child-remove {
    width: 38px; height: 38px; flex-shrink: 0; cursor: pointer;
    border: 1.5px solid #DDE1EF; border-radius: 10px; background: #fff;
    color: var(--di-gray-400); font-size: 1.2rem; line-height: 1;
    transition: border-color .16s, color .16s;
}
.dic-child-remove:hover { border-color: var(--di-danger); color: var(--di-danger); }
.dic-btn-secondary.dic-btn-sm {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 10px 16px; font-size: .9rem; font-weight: 600;
    color: var(--di-primary); background: var(--di-primary-light);
    border: none; border-radius: 999px; cursor: pointer;
    transition: filter .16s;
}
.dic-btn-secondary.dic-btn-sm:hover { filter: brightness(.96); }
.dic-btn-secondary.dic-btn-sm:disabled { opacity: .5; cursor: not-allowed; }

/* ── Navegación ── */
.dic-conv-nav {
    display: flex; align-items: center; gap: 12px;
    margin-top: 28px; padding-top: 22px;
    border-top: 1px solid #EEF0F8;
}
.dic-conv-back {
    display: inline-flex; align-items: center; gap: 6px;
    padding: 12px 16px; cursor: pointer;
    font-size: .9rem; font-weight: 600; color: var(--di-gray-600);
    background: transparent; border: 1.5px solid #DDE1EF; border-radius: 999px;
    transition: border-color .16s, color .16s;
}
.dic-conv-back:hover { border-color: var(--di-primary); color: var(--di-primary); }
.dic-conv-next,
.dic-conv-submit {
    margin-left: auto;
    min-width: 240px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px;
    padding: 15px 30px; cursor: pointer;
    font-size: .95rem; font-weight: 700; letter-spacing: .01em;
    color: #fff; background: var(--di-primary);
    border: none; border-radius: 999px;
    box-shadow: 0 12px 26px rgba(1,44,184,.26);
    transition: background .16s, box-shadow .16s, transform .16s;
}
.dic-conv-next:hover,
.dic-conv-submit:hover { background: var(--di-primary-hover); transform: translateY(-2px); box-shadow: 0 16px 32px rgba(1,44,184,.32); }
.dic-conv-submit .dic-btn-loading { display: inline-flex; align-items: center; gap: 8px; }
.dic-spinner {
    width: 16px; height: 16px; border-radius: 50%;
    border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
    display: inline-block; animation: dic-spin .7s linear infinite;
}
@keyframes dic-spin { to { transform: rotate(360deg); } }

.dic-conv-skip-wrap { text-align: center; margin: 14px 0 0; }
.dic-btn-link {
    background: none; border: none; cursor: pointer;
    font-size: .85rem; color: var(--di-gray-400); text-decoration: underline;
}
.dic-btn-link:hover { color: var(--di-primary); }

.dic-conv-hint-key {
    text-align: center; margin: 16px 0 0;
    font-size: .78rem; color: var(--di-gray-400);
}
.dic-conv-hint-key kbd {
    font-family: inherit; font-size: .72rem; font-weight: 600;
    background: #EEF0F8; color: var(--di-gray-600);
    padding: 2px 7px; border-radius: 6px; border: 1px solid #DDE1EF;
}

.dic-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;
}

/* ── Responsive ── */
@media (max-width: 620px) {
    .dic-conv-hero { padding: 44px 0 28px; }
    .dic-conv { padding: 22px 18px 24px; border-radius: 22px 22px 22px 38px; }
    .dic-conv-shell { padding: 0 0 60px; }
    .dic-conv-nav { flex-wrap: wrap; }
    .dic-conv-next, .dic-conv-submit { width: 100%; margin-left: 0; }
    .dic-optbtns { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
    .dic-q.dic-anim-in-right, .dic-q.dic-anim-in-left { animation: none; }
    .dic-conv-bar-fill { transition: none; }
    .dic-conv-next:hover, .dic-conv-submit:hover { transform: none; }
}
