/* ══════════════════════════════════════════════════════════
   styles-public.css
   Estilos públicos — Industrias Boris
   Directorio raíz (mismo nivel que index.php y gracias.php)
   ══════════════════════════════════════════════════════════ */

/* ── Variables ── */
:root {
    --teal:        #79a7a6;
    --teal-dark:   #5a8a89;
    --teal-light:  #9bc5c4;
    --teal-bg:     rgba(121,167,166,.12);
    --navy:        #1a2744;
    --navy-mid:    #1e2937;
    --white:       #ffffff;
    --gray-50:     #f8fafc;
    --gray-100:    #f1f5f9;
    --gray-200:    #e2e8f0;
    --gray-400:    #94a3b8;
    --gray-500:    #64748b;
    --gray-700:    #475569;
    --gray-900:    #1e2937;
    --green:       #10b981;
    --green-bg:    #d1fae5;
    --red:         #ef4444;
    --red-bg:      #fee2e2;
    --amber:       #f59e0b;
    --radius-sm:   6px;
    --radius-md:   10px;
    --radius-lg:   16px;
    --shadow-sm:   0 2px 8px rgba(0,0,0,.05);
    --shadow-md:   0 8px 24px rgba(0,0,0,.08);
    --shadow-lg:   0 15px 40px rgba(0,0,0,.12);
    --transition:  .2s ease;
}

/* ── Reset & Base ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
    font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
    background: linear-gradient(150deg, var(--gray-50) 0%, var(--gray-100) 100%);
    min-height: 100vh;
    color: var(--gray-900);
    line-height: 1.6;
    display: flex;
    flex-direction: column;
}

/* ══════════════════════════════════════
   HEADER
   ══════════════════════════════════════ */
.pub-header {
    background: linear-gradient(135deg, var(--navy) 0%, #243356 100%);
    color: var(--white);
    padding: 1.25rem 2rem;
    text-align: center;
    box-shadow: 0 4px 20px rgba(0,0,0,.25);
    position: relative;
    overflow: hidden;
}
.pub-header::before {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 70% 50%, rgba(121,167,166,.18) 0%, transparent 70%);
    pointer-events: none;
}
.pub-header-inner {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .6rem;
}
.pub-header-logo {
    height: 52px;
    width: auto;
    object-fit: contain;
    filter: brightness(0) invert(1);  /* logo blanco sobre fondo oscuro */
}
.pub-header h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: .02em;
    color: var(--white);
}
.pub-header p {
    font-size: .8rem;
    color: rgba(255,255,255,.75);
}

/* ══════════════════════════════════════
   MAIN WRAPPER
   ══════════════════════════════════════ */
.pub-main {
    flex: 1;
    max-width: 880px;
    width: 100%;
    margin: 0 auto;
    padding: 2rem 1.5rem;
}

/* ══════════════════════════════════════
   BARRA DE PROGRESO
   ══════════════════════════════════════ */
.progress-wrap {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 1.1rem 1.5rem;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow-sm);
    border: 1px solid var(--gray-200);
    position: sticky;
    top: 0;
    z-index: 100;
}
.progress-label {
    display: flex;
    justify-content: space-between;
    font-size: .8rem;
    font-weight: 600;
    color: var(--gray-500);
    margin-bottom: .5rem;
}
.progress-label span:last-child { color: var(--teal-dark); }
.progress-bar-bg {
    background: var(--gray-200);
    border-radius: 99px;
    height: 8px;
    overflow: hidden;
}
.progress-bar-fill {
    background: linear-gradient(90deg, var(--teal) 0%, var(--teal-light) 100%);
    height: 100%;
    border-radius: 99px;
    transition: width .4s ease;
    width: 0%;
}

/* ══════════════════════════════════════
   CARD (datos del candidato)
   ══════════════════════════════════════ */
.pub-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    margin-bottom: 1.5rem;
    border: 1px solid var(--gray-200);
}
.pub-card-header {
    background: var(--gray-50);
    padding: .9rem 1.5rem;
    border-bottom: 1px solid var(--gray-200);
}
.pub-card-header h3 {
    font-size: .95rem;
    font-weight: 700;
    color: var(--teal-dark);
    display: flex;
    align-items: center;
    gap: .5rem;
}
.pub-card-body { padding: 1.5rem; }

/* ── Form grid ── */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}
.form-group { display: flex; flex-direction: column; }
.form-group.full-width { grid-column: 1 / -1; }
.form-group label {
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .06em;
    color: var(--gray-500);
    margin-bottom: .4rem;
}
.form-group input,
.form-group select {
    padding: .7rem 1rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    font-size: .95rem;
    color: var(--gray-900);
    background: var(--white);
    transition: border-color var(--transition), box-shadow var(--transition);
}
.form-group input:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--teal);
    box-shadow: 0 0 0 3px rgba(121,167,166,.18);
}
.form-group input::placeholder { color: var(--gray-400); }

/* ══════════════════════════════════════
   INSTRUCCIONES
   ══════════════════════════════════════ */
.instrucciones {
    background: linear-gradient(135deg, #f1f5f9 0%, #f8fafc 100%);
    border-left: 4px solid var(--teal);
    border-radius: var(--radius-md);
    padding: 1.2rem 1.5rem;
    margin-bottom: 1.5rem;
    font-size: .88rem;
    color: var(--gray-700);
    box-shadow: var(--shadow-sm);
}
.instrucciones mark {
    background: var(--teal);
    color: var(--white);
    padding: .1rem .5rem;
    border-radius: 4px;
    font-weight: 700;
}

/* ══════════════════════════════════════
   BLOQUES DE PREGUNTA
   ══════════════════════════════════════ */
.question-block {
    background: var(--white);
    border-radius: var(--radius-md);
    margin-bottom: 1rem;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    border: 1.5px solid var(--gray-200);
    transition: box-shadow var(--transition), border-color var(--transition);
    scroll-margin-top: 90px; /* para sticky progress bar */
}
.question-block:hover {
    box-shadow: var(--shadow-md);
}
/* Estado completado */
.question-block.completada {
    border-color: var(--green);
}
.question-block.completada .question-title {
    background: var(--green-bg);
    color: #065f46;
}
/* Estado error (sin responder al intentar enviar) */
.question-block.sin-responder {
    border-color: var(--red);
    box-shadow: 0 0 0 3px rgba(239,68,68,.12);
}
.question-block.sin-responder .question-title {
    background: var(--red-bg);
    color: #991b1b;
}

.question-title {
    background: var(--gray-50);
    padding: .65rem 1.25rem;
    font-size: .72rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .1em;
    color: var(--teal-dark);
    border-bottom: 1px solid var(--gray-200);
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background var(--transition), color var(--transition);
}
.question-title .check-icon {
    font-size: 1rem;
    opacity: 0;
    transition: opacity var(--transition);
}
.question-block.completada .question-title .check-icon { opacity: 1; }

.question-block table { width: 100%; border-collapse: collapse; }
.question-block thead th {
    padding: .55rem 1rem;
    font-size: .68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .05em;
    color: var(--gray-500);
    background: #fafafa;
    border-bottom: 1px solid var(--gray-200);
}
.question-block .col-text  { text-align: left; width: 70%; }
.question-block .col-radio { text-align: center; width: 15%; }
.question-block tbody tr {
    border-bottom: 1px solid var(--gray-100);
    transition: background var(--transition);
}
.question-block tbody tr:last-child { border-bottom: none; }
.question-block tbody tr:hover { background: #fafafa; }
.question-block tbody td {
    padding: .85rem 1rem;
    vertical-align: middle;
    font-size: .88rem;
}
.question-block tbody td strong { color: var(--gray-900); }
.question-block tbody td .desc {
    color: var(--gray-500);
    font-size: .78rem;
    margin-top: .15rem;
}
.question-block input[type="radio"] {
    width: 20px;
    height: 20px;
    accent-color: var(--teal);
    cursor: pointer;
}

/* ══════════════════════════════════════
   BOTÓN ENVIAR
   ══════════════════════════════════════ */
.btn-submit-wrap {
    text-align: center;
    margin-top: 2rem;
    padding-bottom: 1rem;
}
.btn-submit {
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
    color: var(--white);
    border: none;
    padding: 1rem 3rem;
    font-size: 1.05rem;
    font-weight: 700;
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: transform var(--transition), box-shadow var(--transition), opacity var(--transition);
    letter-spacing: .02em;
    position: relative;
}
.btn-submit:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(121,167,166,.4);
}
.btn-submit:disabled {
    opacity: .7;
    cursor: not-allowed;
    transform: none;
}

/* ══════════════════════════════════════
   MODAL DE CONFIRMACIÓN
   ══════════════════════════════════════ */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(10,20,40,.55);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9999;
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease;
    padding: 1rem;
}
.modal-overlay.visible {
    opacity: 1;
    pointer-events: all;
}
.modal-box {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 2rem 2rem 1.5rem;
    max-width: 420px;
    width: 100%;
    box-shadow: 0 25px 60px rgba(0,0,0,.2);
    text-align: center;
    transform: scale(.95);
    transition: transform .25s ease;
}
.modal-overlay.visible .modal-box { transform: scale(1); }
.modal-icon { font-size: 2.5rem; margin-bottom: .75rem; }
.modal-box h3 { font-size: 1.2rem; color: var(--navy); margin-bottom: .5rem; }
.modal-box p  { color: var(--gray-500); font-size: .9rem; margin-bottom: 1.5rem; line-height: 1.5; }
.modal-actions { display: flex; gap: .75rem; justify-content: center; }
.btn-modal-cancel {
    padding: .7rem 1.75rem;
    border: 1.5px solid var(--gray-200);
    border-radius: var(--radius-sm);
    background: var(--white);
    color: var(--gray-700);
    font-size: .9rem;
    font-weight: 600;
    cursor: pointer;
    transition: background var(--transition);
}
.btn-modal-cancel:hover { background: var(--gray-100); }
.btn-modal-confirm {
    padding: .7rem 1.75rem;
    border: none;
    border-radius: var(--radius-sm);
    background: linear-gradient(135deg, var(--teal) 0%, var(--teal-light) 100%);
    color: var(--white);
    font-size: .9rem;
    font-weight: 700;
    cursor: pointer;
    transition: box-shadow var(--transition);
}
.btn-modal-confirm:hover {
    box-shadow: 0 4px 14px rgba(121,167,166,.4);
}

/* ══════════════════════════════════════
   TOAST / AVISO DE BORRADOR RECUPERADO
   ══════════════════════════════════════ */
.toast {
    position: fixed;
    bottom: 1.5rem;
    left: 50%;
    transform: translateX(-50%) translateY(80px);
    background: var(--navy);
    color: var(--white);
    padding: .8rem 1.4rem;
    border-radius: var(--radius-md);
    font-size: .85rem;
    font-weight: 600;
    z-index: 8888;
    box-shadow: 0 8px 30px rgba(0,0,0,.25);
    transition: transform .35s cubic-bezier(.34,1.56,.64,1);
    display: flex;
    align-items: center;
    gap: .6rem;
    white-space: nowrap;
}
.toast.visible { transform: translateX(-50%) translateY(0); }
.toast-close {
    background: none;
    border: none;
    color: var(--gray-400);
    cursor: pointer;
    font-size: 1rem;
    line-height: 1;
    padding: 0 .2rem;
}

/* ══════════════════════════════════════
   PÁGINA GRACIAS
   ══════════════════════════════════════ */
.thanks-wrapper {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem 1.5rem;
}
.thanks-card {
    background: var(--white);
    border-radius: var(--radius-lg);
    padding: 3rem 2.5rem;
    text-align: center;
    box-shadow: var(--shadow-lg);
    max-width: 520px;
    width: 100%;
    border: 1px solid var(--gray-200);
    animation: fadeUp .5s ease forwards;
}
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
.thanks-icon {
    width: 90px;
    height: 90px;
    background: var(--green-bg);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1.5rem;
    font-size: 2.5rem;
}
.thanks-card h1 {
    color: var(--navy);
    margin-bottom: .75rem;
    font-size: 1.6rem;
    font-weight: 700;
}
.thanks-card .candidato-nombre {
    font-size: 1.1rem;
    color: var(--teal-dark);
    font-weight: 700;
    margin-bottom: 1rem;
}
.thanks-card p {
    color: var(--gray-500);
    line-height: 1.65;
    margin-bottom: .4rem;
    font-size: .95rem;
}
.thanks-card .highlight-msg {
    margin-top: 1rem;
    background: var(--teal-bg);
    border-radius: var(--radius-sm);
    padding: .85rem 1rem;
    color: var(--teal-dark);
    font-weight: 600;
    font-size: .9rem;
}
.thanks-divider {
    margin-top: 2rem;
    padding-top: 1.25rem;
    border-top: 1px solid var(--gray-200);
    font-size: .8rem;
    color: var(--gray-400);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .6rem;
}
.thanks-divider img {
    height: 22px;
    filter: grayscale(1) opacity(.5);
}

/* ══════════════════════════════════════
   FOOTER
   ══════════════════════════════════════ */
.pub-footer {
    background: var(--navy);
    color: var(--gray-400);
    text-align: center;
    padding: 1.25rem;
    font-size: .8rem;
    margin-top: auto;
}
.pub-footer a { color: var(--teal-light); text-decoration: none; }

/* ══════════════════════════════════════
   RESPONSIVE
   ══════════════════════════════════════ */
@media (max-width: 640px) {
    .pub-header       { padding: 1rem; }
    .pub-header h1    { font-size: 1.1rem; }
    .pub-main         { padding: 1rem; }
    .form-grid        { grid-template-columns: 1fr; }
    .question-block .col-text  { width: 58%; }
    .question-block .col-radio { width: 21%; }
    .question-block thead th,
    .question-block tbody td   { padding: .6rem .5rem; font-size: .8rem; }
    .btn-submit       { width: 100%; padding: .95rem; }
    .modal-actions    { flex-direction: column-reverse; }
    .btn-modal-cancel,
    .btn-modal-confirm { width: 100%; }
}
