/* ═══════════════════════════════════════════════════════════════════
   Encuesta de Satisfacción – Kalisch Recycling
   style.css | ISO 9001:2015 FUN-FOR-09 Portal
   Paleta oficial: Verde #203b1f | Gris #9c9aa0
   ═══════════════════════════════════════════════════════════════════ */

/* ── Variables de diseño – Paleta Oficial Kalisch ────────────────── */
:root {
    /* Verde oficial del logo horizontal */
    --green-dark:    #203b1f;   /* Verde principal (logo, títulos) */
    --green-mid:     #2e5430;   /* Verde hover / activo */
    --green-light:   #3d6e3b;   /* Verde botones secundarios */
    --green-pale:    #e8f0e7;   /* Verde fondo suave */
    --green-dim:     #d4e7d3;   /* Verde selección activa */

    /* Gris oficial de la paleta */
    --gray-brand:    #9c9aa0;   /* Gris corporativo */
    --gray-light:    #f4f4f5;   /* Fondo de página */
    --gray-100:      #f1f1f3;   /* Fondo cards */
    --gray-200:      #e4e4e8;   /* Bordes */
    --gray-400:      #9c9aa0;   /* Texto secundario */
    --gray-600:      #5a5860;   /* Texto párrafos */
    --gray-800:      #1a1820;   /* Texto principal */
    --white:         #ffffff;

    /* Semáforo de calificaciones */
    --red:           #c0392b;
    --red-dim:       #fdecea;
    --amber:         #d97706;
    --amber-dim:     #fef3c7;

    /* Layout */
    --radius-sm:     8px;
    --radius-md:     12px;
    --radius-lg:     20px;
    --shadow-sm:     0 1px 3px rgba(0,0,0,.07), 0 1px 2px rgba(0,0,0,.04);
    --shadow-md:     0 4px 16px rgba(0,0,0,.09), 0 2px 6px rgba(0,0,0,.05);
    --shadow-lg:     0 10px 40px rgba(0,0,0,.12), 0 4px 16px rgba(0,0,0,.07);
    --transition:    .2s cubic-bezier(.4,0,.2,1);
    --font:          'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Reset & base ────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    font-family: var(--font);
    background: var(--gray-light);
    color: var(--gray-800);
    line-height: 1.6;
    min-height: 100vh;
}

/* ── Pantallas ───────────────────────────────────────────────────── */
.screen { display: none; }
.screen.active { display: flex; flex-direction: column; min-height: 100vh; }

/* ── Pantalla de carga ───────────────────────────────────────────── */
#screen-loading {
    align-items: center;
    justify-content: center;
    background: var(--green-dark);
}
.loading-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    color: var(--white);
}
.spinner {
    width: 52px; height: 52px;
    border: 4px solid rgba(255,255,255,.2);
    border-top-color: rgba(255,255,255,.85);
    border-radius: 50%;
    animation: spin .9s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.loading-text {
    font-size: 1rem;
    font-weight: 500;
    opacity: .82;
    letter-spacing: .03em;
}

/* ── Content wrapper ─────────────────────────────────────────────── */
.content-wrapper {
    width: 100%;
    max-width: 860px;
    margin: 0 auto;
    padding: 0 20px 60px;
}

/* ── Header ──────────────────────────────────────────────────────── */
.site-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 1px;
    border-bottom: 1.5px solid var(--gray-200);
    margin-bottom: 28px;
}
.logo {
    height: 150px;            /* ← AQUÍ CONTROLAS EL TAMAÑO DEL LOGO */
    width: auto;
    max-width: 260px;
    object-fit: contain;
    transition: transform var(--transition);
}
.logo:hover {
    transform: scale(1.02);
}
.header-info {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
}
.doc-code {
    font-size: .75rem;
    font-weight: 700;
    color: var(--green-dark);
    letter-spacing: .06em;
    background: var(--green-pale);
    border: 1px solid var(--green-dim);
    padding: 4px 12px;
    border-radius: 100px;
}
.doc-rev {
    font-size: .7rem;
    color: var(--gray-400);
    padding-right: 4px;
}

/* ── Hero banner ─────────────────────────────────────────────────── */
.hero-banner {
    background: linear-gradient(135deg, var(--green-dark) 0%, var(--green-mid) 100%);
    border-radius: var(--radius-lg);
    padding: 40px 36px;
    margin-bottom: 28px;
    position: relative;
    overflow: hidden;
}
.hero-banner::before {
    content: '';
    position: absolute;
    top: -50px; right: -50px;
    width: 220px; height: 220px;
    background: rgba(255,255,255,.05);
    border-radius: 50%;
}
.hero-banner::after {
    content: '';
    position: absolute;
    bottom: -70px; left: 25%;
    width: 300px; height: 300px;
    background: rgba(255,255,255,.03);
    border-radius: 50%;
}
.hero-content { position: relative; z-index: 1; }
.hero-banner h1 {
    font-size: 1.55rem;
    font-weight: 700;
    color: var(--white);
    margin-bottom: 10px;
    line-height: 1.3;
}
.hero-sub {
    font-size: .9rem;
    color: rgba(255,255,255,.78);
    margin-bottom: 24px;
    line-height: 1.65;
}

.client-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,.13);
    border: 1px solid rgba(255,255,255,.22);
    border-radius: 100px;
    padding: 9px 20px;
    backdrop-filter: blur(4px);
    flex-wrap: wrap;
}
.client-label { font-size: .75rem; color: rgba(255,255,255,.65); font-weight: 500; }
.client-name  { font-size: .93rem; color: var(--white); font-weight: 700; }
.year-badge {
    background: rgba(255,255,255,.2);
    color: var(--white);
    font-size: .72rem;
    font-weight: 700;
    padding: 3px 12px;
    border-radius: 100px;
    letter-spacing: .05em;
    border: 1px solid rgba(255,255,255,.3);
}

/* ── Sección ─────────────────────────────────────────────────────── */
.form-section {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 28px 28px 32px;
    margin-bottom: 18px;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
}
.section-header {
    display: flex;
    align-items: flex-start;
    gap: 16px;
    margin-bottom: 24px;
}
.section-number {
    flex-shrink: 0;
    width: 36px; height: 36px;
    background: var(--green-dark);
    color: var(--white);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: .86rem;
    font-weight: 700;
    margin-top: 2px;
}
.section-header h2 {
    font-size: 1.05rem;
    font-weight: 600;
    color: var(--green-dark);
}
.section-desc {
    font-size: .8rem;
    color: var(--gray-600);
    margin-top: 3px;
}

/* ── Leyenda de escala ───────────────────────────────────────────── */
.scale-legend {
    display: flex;
    gap: 12px;
    margin-bottom: 20px;
    flex-wrap: wrap;
    padding: 14px 16px;
    background: var(--gray-100);
    border-radius: var(--radius-md);
}
.legend-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: .78rem;
    font-weight: 600;
    padding: 5px 12px;
    border-radius: 100px;
}
.legend-item.level-1 { background: var(--red-dim);   color: var(--red); }
.legend-item.level-2 { background: var(--amber-dim); color: var(--amber); }
.legend-item.level-3 { background: var(--green-dim); color: var(--green-dark); }

/* ── Grid de criterios ───────────────────────────────────────────── */
.criteria-grid {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.criterion-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 15px 18px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.criterion-card:hover { border-color: var(--gray-brand); background: var(--gray-100); }
.criterion-card.selected {
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(32,59,31,.09);
    background: var(--green-pale);
}

.criterion-info { flex: 1; min-width: 0; }
.criterion-num  {
    font-size: .68rem;
    font-weight: 700;
    color: var(--gray-brand);
    text-transform: uppercase;
    letter-spacing: .08em;
}
.criterion-name {
    font-size: .9rem;
    font-weight: 500;
    color: var(--gray-800);
    margin-top: 2px;
}

.criterion-buttons {
    display: flex;
    gap: 6px;
    flex-shrink: 0;
}

.rating-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    width: 74px;
    padding: 10px 6px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
}
.rating-btn:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); border-color: var(--gray-brand); }
.rating-btn .emoji { font-size: 1.3rem; line-height: 1; }
.rating-btn .label { font-size: .6rem; font-weight: 600; color: var(--gray-600); text-align: center; white-space: nowrap; }

/* Estados activos de calificación */
.rating-btn[data-val="1"].active {
    background: var(--red-dim);
    border-color: var(--red);
    box-shadow: 0 0 0 2px rgba(192,57,43,.15);
}
.rating-btn[data-val="1"].active .label { color: var(--red); }

.rating-btn[data-val="2"].active {
    background: var(--amber-dim);
    border-color: var(--amber);
    box-shadow: 0 0 0 2px rgba(217,119,6,.15);
}
.rating-btn[data-val="2"].active .label { color: var(--amber); }

.rating-btn[data-val="3"].active {
    background: var(--green-dim);
    border-color: var(--green-dark);
    box-shadow: 0 0 0 2px rgba(32,59,31,.15);
}
.rating-btn[data-val="3"].active .label { color: var(--green-dark); }

/* ── Grid Sí/No ──────────────────────────────────────────────────── */
.yn-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 14px;
}
@media (max-width: 600px) { .yn-grid { grid-template-columns: 1fr; } }

.yn-card {
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 14px;
    transition: border-color var(--transition), box-shadow var(--transition), background var(--transition);
}
.yn-card.selected {
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(32,59,31,.09);
    background: var(--green-pale);
}
.yn-question {
    font-size: .88rem;
    font-weight: 500;
    color: var(--gray-800);
    line-height: 1.55;
}
.yn-options { display: flex; gap: 8px; }
.yn-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 13px 8px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    cursor: pointer;
    transition: all var(--transition);
    font-family: var(--font);
    font-size: .82rem;
    font-weight: 600;
    color: var(--gray-600);
}
.yn-btn:hover { transform: translateY(-1px); box-shadow: var(--shadow-sm); border-color: var(--gray-brand); }
.yn-icon { font-size: 1.5rem; }

.yn-btn.active[data-val="true"] {
    background: var(--green-dim);
    border-color: var(--green-dark);
    color: var(--green-dark);
    box-shadow: 0 0 0 2px rgba(32,59,31,.12);
}
.yn-btn.active[data-val="false"] {
    background: var(--red-dim);
    border-color: var(--red);
    color: var(--red);
    box-shadow: 0 0 0 2px rgba(192,57,43,.12);
}

/* ── Textarea comentarios ────────────────────────────────────────── */
.textarea-comments {
    width: 100%;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-md);
    padding: 14px 16px;
    font-family: var(--font);
    font-size: .9rem;
    color: var(--gray-800);
    resize: vertical;
    transition: border-color var(--transition), box-shadow var(--transition);
    line-height: 1.6;
    background: var(--white);
}
.textarea-comments:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(32,59,31,.1);
}
.textarea-comments::placeholder { color: var(--gray-400); }
.char-count {
    text-align: right;
    font-size: .72rem;
    color: var(--gray-400);
    margin-top: 6px;
}

/* ── Campos evaluador ────────────────────────────────────────────── */
.evaluador-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}
@media (max-width: 600px) { .evaluador-grid { grid-template-columns: 1fr; } }

.field-group { display: flex; flex-direction: column; gap: 7px; }
.field-group label {
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-600);
    letter-spacing: .02em;
}
.required { color: var(--red); margin-left: 2px; }
.field-input {
    padding: 12px 14px;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-family: var(--font);
    font-size: .9rem;
    color: var(--gray-800);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.field-input:focus {
    outline: none;
    border-color: var(--green-dark);
    box-shadow: 0 0 0 3px rgba(32,59,31,.1);
}
.field-input::placeholder { color: var(--gray-400); }

/* ── Área de envío ───────────────────────────────────────────────── */
.submit-area {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 14px;
    padding: 16px 0 10px;
}
.validation-msg {
    font-size: .85rem;
    color: var(--red);
    font-weight: 500;
    text-align: center;
    min-height: 22px;
    padding: 0 12px;
}
.btn-submit {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--green-dark);
    color: var(--white);
    border: none;
    border-radius: 100px;
    padding: 16px 48px;
    font-family: var(--font);
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all var(--transition);
    box-shadow: 0 4px 18px rgba(32,59,31,.35);
    letter-spacing: .02em;
}
.btn-submit:hover:not(:disabled) {
    background: var(--green-mid);
    transform: translateY(-2px);
    box-shadow: 0 6px 26px rgba(32,59,31,.45);
}
.btn-submit:active { transform: translateY(0); }
.btn-submit:disabled {
    background: var(--gray-brand);
    cursor: not-allowed;
    box-shadow: none;
    transform: none;
}
.btn-icon { font-size: 1.1rem; }
.submit-note {
    font-size: .75rem;
    color: var(--gray-400);
    text-align: center;
}

/* ── Error card ──────────────────────────────────────────────────── */
#screen-error {
    background: var(--gray-light);
    align-items: center;
    justify-content: flex-start;
}
.error-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 52px 36px;
    text-align: center;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-200);
    margin: 12px 0;
}
.error-icon { font-size: 3rem; margin-bottom: 16px; }
.error-card h2 { font-size: 1.3rem; color: var(--green-dark); margin-bottom: 10px; font-weight: 700; }
.error-card p  { font-size: .9rem; color: var(--gray-600); line-height: 1.65; }
.contact-hint  { margin-top: 16px; font-size: .82rem; color: var(--gray-400); }

/* ── Pantalla de gracias ─────────────────────────────────────────── */
#screen-gracias {
    background: var(--gray-light);
    align-items: flex-start;
}
.gracias-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 52px 36px;
    text-align: center;
    box-shadow: var(--shadow-lg);
    border: 1px solid var(--gray-200);
    margin: 12px 0;
}

/* Animación check ───────────────────────────────────────────────── */
.check-circle { width: 90px; height: 90px; margin: 0 auto; }
.check-svg    { width: 90px; height: 90px; }

.check-circle-bg {
    stroke: var(--green-dark);
    stroke-width: 2.5;
    stroke-dasharray: 157;
    stroke-dashoffset: 157;
    transform: rotate(-90deg);
    transform-origin: center;
    animation: draw-circle .65s ease-out .2s forwards;
}
@keyframes draw-circle { to { stroke-dashoffset: 0; } }

.check-mark {
    stroke: var(--green-dark);
    stroke-width: 3.5;
    stroke-linecap: round;
    stroke-linejoin: round;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    animation: draw-check .4s ease-out .9s forwards;
}
@keyframes draw-check { to { stroke-dashoffset: 0; } }

.gracias-card h2 {
    font-size: 1.6rem;
    font-weight: 700;
    color: var(--green-dark);
    margin-bottom: 8px;
}
.gracias-sub {
    font-size: 1rem;
    color: var(--green-mid);
    font-weight: 600;
    margin-bottom: 24px;
}
.gracias-detail {
    max-width: 480px;
    margin: 0 auto;
    text-align: left;
    background: var(--green-pale);
    border-radius: var(--radius-md);
    padding: 20px 24px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    border: 1px solid var(--green-dim);
}
.gracias-detail p { font-size: .87rem; color: var(--gray-600); line-height: 1.65; }
.iso-note { font-size: .78rem !important; color: var(--gray-brand) !important; }

/* ── Footer ──────────────────────────────────────────────────────── */
.site-footer {
    margin-top: 36px;
    padding-top: 20px;
    border-top: 1px solid var(--green-pale);
    text-align: center;
    font-size: .76rem;
    color: var(--gray-brand);
}

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 720px) {
    .hero-banner { padding: 28px 22px; }
    .hero-banner h1 { font-size: 1.25rem; }
    .form-section { padding: 20px 16px 24px; }
    .criterion-card { flex-direction: column; align-items: flex-start; }
    .criterion-buttons { width: 100%; justify-content: stretch; }
    .rating-btn { flex: 1; width: auto; }
    .btn-submit { padding: 14px 32px; font-size: .95rem; }
}
@media (max-width: 420px) {
    .scale-legend { flex-direction: column; gap: 8px; }
    .rating-btn .label { font-size: .58rem; }
    .hero-banner h1 { font-size: 1.1rem; }
}
