/* =============================================
   TrackLink — Encuesta de Cliente
   Color base: #1c2f41 (azul marino profundo)
   ============================================= */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@600;700&display=swap');

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy:        #1c2f41;
    --navy-light:  #243d56;
    --navy-dark:   #142232;
    --accent:      #2e7bcf;
    --accent-soft: #e8f2fc;
    --white:       #ffffff;
    --off-white:   #f5f7fa;
    --border:      #dde3ea;
    --text-main:   #1a2533;
    --text-muted:  #6b7a8d;
    --success:     #1fa363;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
}

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--off-white);
    color: var(--text-main);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ── HEADER ─────────────────────────────────── */
.site-header {
    background-color: var(--navy);
    padding: 0 2rem;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    box-shadow: 0 2px 8px rgba(0,0,0,.20);
}

.logo-area {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
}

.logo-icon {
    width: 36px;
    height: 36px;
    background-color: var(--accent);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-icon svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.logo-name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: .3px;
}

.logo-name span {
    color: #6cb8f5;
}

.header-badge {
    font-size: .72rem;
    font-weight: 600;
    color: #a8c8e8;
    letter-spacing: .8px;
    text-transform: uppercase;
}

/* ── PROGRESO ────────────────────────────────── */
.progress-bar-wrap {
    height: 4px;
    background: var(--border);
}

.progress-bar-fill {
    height: 100%;
    width: 0%;
    background: var(--accent);
    transition: width .35s ease;
}

/* ── LAYOUT PRINCIPAL ────────────────────────── */
.page-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 2.5rem 1rem 4rem;
}

/* ── HERO DEL FORMULARIO ─────────────────────── */
.survey-hero {
    text-align: center;
    margin-bottom: 2rem;
    max-width: 600px;
}

.survey-hero .eyebrow {
    display: inline-block;
    font-size: .75rem;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--accent);
    background: var(--accent-soft);
    border-radius: 20px;
    padding: 4px 14px;
    margin-bottom: .75rem;
}

.survey-hero h1 {
    font-family: 'Poppins', sans-serif;
    font-size: 1.65rem;
    font-weight: 700;
    color: var(--navy);
    line-height: 1.25;
    margin-bottom: .5rem;
}

.survey-hero p {
    font-size: .9rem;
    color: var(--text-muted);
}

/* ── TARJETA PRINCIPAL ───────────────────────── */
.survey-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border);
    box-shadow: 0 4px 24px rgba(28,47,65,.07);
    width: 100%;
    max-width: 760px;
    overflow: hidden;
}

.survey-card-header {
    background: var(--navy);
    padding: 1.25rem 1.75rem;
    display: flex;
    align-items: center;
    gap: 12px;
}

.survey-card-header .counter {
    font-size: .78rem;
    font-weight: 600;
    color: #7fb8e0;
    letter-spacing: .5px;
}

.survey-card-header .title {
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    color: var(--white);
}

.survey-card-body {
    padding: 1.75rem;
}

/* ── PREGUNTAS ───────────────────────────────── */
.question-block {
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.question-block:last-of-type {
    border-bottom: none;
}

.question-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--navy);
    color: #fff;
    font-size: .7rem;
    font-weight: 700;
    margin-right: 8px;
    flex-shrink: 0;
}

.question-label {
    display: flex;
    align-items: flex-start;
    font-size: .95rem;
    font-weight: 600;
    color: var(--text-main);
    margin-bottom: 1rem;
    line-height: 1.4;
}

/* Input de texto */
.field-input {
    width: 100%;
    padding: .6rem .9rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    font-size: .9rem;
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background: var(--off-white);
    outline: none;
    transition: border-color .2s, box-shadow .2s;
}

.field-input:focus {
    border-color: var(--accent);
    background: var(--white);
    box-shadow: 0 0 0 3px rgba(46,123,207,.12);
}

/* Radio y Checkbox personalizados */
.options-group {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Escala numérica (ej: NPS 1-10) en fila horizontal */
.options-group-scale {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
}

.custom-option-scale {
    flex: 1 1 0;
    max-width: 60px;
    aspect-ratio: 1 / 1;
    height: auto;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.custom-option-scale .option-text {
    margin: 0;
}

/* Espacio cuando hay opciones de texto extra debajo de la escala */
.options-group-extra {
    margin-top: 10px;
}

.custom-option {
    display: flex;
    align-items: center;
    gap: 12px;
    cursor: pointer;
    padding: .7rem 1rem;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    transition: border-color .2s, background .2s;
    user-select: none;
}

.custom-option:hover {
    border-color: var(--accent);
    background: var(--accent-soft);
}

.custom-option input[type="radio"],
.custom-option input[type="checkbox"] {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 2px solid var(--border);
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color .2s, background .2s;
    position: relative;
    cursor: pointer;
}

.custom-option input[type="checkbox"] {
    border-radius: 5px;
}

.custom-option input[type="radio"]:checked,
.custom-option input[type="checkbox"]:checked {
    background-color: var(--navy);
    border-color: var(--navy);
}

.custom-option input[type="radio"]:checked::after {
    content: '';
    display: block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #fff;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.custom-option input[type="checkbox"]:checked::after {
    content: '';
    display: block;
    width: 5px;
    height: 9px;
    border: 2px solid #fff;
    border-top: none;
    border-left: none;
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translate(-50%, -50%) rotate(45deg);
}

.custom-option input:checked ~ .option-text {
    color: var(--navy);
    font-weight: 500;
}

.option-text {
    font-size: .9rem;
    color: var(--text-main);
    transition: color .2s;
}

/* Resaltar la opción seleccionada */
.custom-option:has(input:checked) {
    border-color: var(--navy);
    background: #edf3f9;
}

/* ── BOTÓN ENVIAR ────────────────────────────── */
.btn-submit {
    display: block;
    width: 100%;
    padding: .9rem 1.5rem;
    background: var(--navy);
    color: var(--white);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: none;
    border-radius: var(--radius-md);
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s, transform .1s, opacity .2s;
    margin-top: 1.5rem;
}

.btn-submit:hover:not(:disabled) {
    background: var(--navy-light);
}

.btn-submit:active:not(:disabled) {
    transform: scale(.985);
    background: var(--navy-dark);
}

.btn-submit:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── BOTÓN SECUNDARIO (Anterior) ─────────────── */
.btn-secondary {
    display: block;
    width: 100%;
    padding: .9rem 1.5rem;
    background: var(--white);
    color: var(--navy);
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    font-weight: 600;
    border: 1.5px solid var(--border);
    border-radius: var(--radius-md);
    cursor: pointer;
    letter-spacing: .3px;
    transition: background .2s, border-color .2s, transform .1s;
}

.btn-secondary:hover:not(:disabled) {
    background: var(--accent-soft);
    border-color: var(--accent);
}

.btn-secondary:active:not(:disabled) {
    transform: scale(.985);
}

.btn-secondary:disabled {
    opacity: .45;
    cursor: not-allowed;
}

/* ── CONTROLES DE PAGINACIÓN ─────────────────── */
.pagination-controls {
    display: flex;
    gap: .75rem;
    margin-top: 1.5rem;
}

.pagination-controls .btn-secondary,
.pagination-controls .btn-submit {
    flex: 1;
    margin-top: 0;
}

/* ── TOAST DE ERROR (esquina superior derecha) ── */
.toast-error {
    position: fixed;
    top: 16px;
    right: 16px;
    left: auto;
    transform: translateX(8px) translateY(-8px);
    background: var(--white);
    border: 1.5px solid #f0997b;
    border-left: 4px solid #d85a30;
    border-radius: var(--radius-md);
    padding: .65rem .9rem;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    max-width: calc(100% - 32px);
    width: 300px;
    box-shadow: 0 6px 18px rgba(28,47,65,.16);
    z-index: 1000;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease, transform .2s ease;
}

.toast-error.show {
    opacity: 1;
    transform: translateX(0) translateY(0);
    pointer-events: auto;
}

.toast-error .toast-icon {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: #fcebeb;
    color: #a32d2d;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .68rem;
    font-weight: 700;
}

.toast-error .toast-text {
    font-size: .8rem;
    color: var(--text-main);
    line-height: 1.35;
}

.toast-error .toast-text strong {
    display: block;
    font-size: .82rem;
    color: #993c1d;
    margin-bottom: 1px;
}

/* Resaltar pregunta sin responder */
.question-block.has-error .question-label {
    color: #a32d2d;
}

.question-block.has-error .field-input,
.question-block.has-error .custom-option {
    border-color: #d85a30;
}

/* ── ÍCONO DE ERROR (vista custom_404) ───────── */
.error-icon-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: #fcebeb;
    color: #a32d2d;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.25rem;
}

/* ── FOOTER ──────────────────────────────────── */
.site-footer {
    text-align: center;
    padding: 1.5rem;
    font-size: .78rem;
    color: var(--text-muted);
}

.site-footer a {
    color: var(--accent);
    text-decoration: none;
}

/* ── RESPONSIVE ──────────────────────────────── */
@media (max-width: 640px) {
    .site-header { padding: 0 1.1rem; }
    .header-badge { display: none; }
    .survey-hero h1 { font-size: 1.3rem; }
    .survey-card-body { padding: 1.25rem; }
    .custom-option { padding: .6rem .8rem; }
    .toast-error { top: 10px; right: 10px; width: calc(100% - 20px); }
    .custom-option-scale { max-width: 42px; }
}

.logo-image{
    height:32px;
    width:auto;
    object-fit:contain;
}