* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --qhse-blueberry: #1C2543;
    --qhse-blue: #0F4C81;
    --qhse-blue-mid: #223262;
    --qhse-surface: #FFFFFF;
    --qhse-background: #F5F7FA;
    --qhse-text: #1C2543;
    --qhse-muted: #5F6878;
    --qhse-border: #D8DEE8;
    --primary: var(--qhse-blue);
    --primary-light: #eef3fa;
    --accent: #00a878;
    --background: var(--qhse-background);
    --surface: var(--qhse-surface);
    --text: var(--qhse-text);
    --text-secondary: var(--qhse-muted);
    --border: var(--qhse-border);
    --error: #c62828;
    --radius: 14px;
}

body {
    font-family: "Segoe UI", Arial, sans-serif;
    background: var(--background);
    color: var(--text);
    line-height: 1.5;
}

.page-container {
    width: 100%;
    min-height: 100vh;
    padding: 0;
}

.form-card {
    width: 100%;
    margin: 0 auto;
    background: var(--surface);
    overflow: hidden;
}

/* HEADER */

.form-header {
    background: var(--qhse-blueberry);
    color: white;
    padding: 42px 46px;
}

.brand {
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    margin-bottom: 18px;
    opacity: 0.9;
}

.form-logo {
    display: block;
    width: min(100%, 250px);
    height: auto;
    object-fit: contain;
    margin-bottom: 24px;
}

.form-subtitle {
    margin-bottom: 8px;
    font-weight: 600;
}

.form-header h1 {
    font-size: 32px;
    line-height: 1.2;
    margin-bottom: 12px;
}

.form-header p {
    font-size: 17px;
}

.form-header .intro {
    margin-top: 18px;
    max-width: 680px;
    font-size: 15px;
    opacity: 0.9;
}

/* SECCIONES */

.form-section {
    padding: 36px 46px;
    border-bottom: 1px solid var(--border);
}

.form-section h2 {
    font-size: 22px;
    margin: 8px 0 25px;
}

.step {
    display: inline-block;
    color: var(--primary);
    background: var(--primary-light);
    padding: 5px 11px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
}

/* CAMPOS */

.field {
    margin-bottom: 22px;
}

.field:last-child {
    margin-bottom: 0;
}

label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

input,
select,
textarea {
    width: 100%;
    border: 1px solid var(--border);
    background: white;
    border-radius: 10px;
    padding: 13px 14px;
    font-family: inherit;
    font-size: 15px;
    color: var(--text);
    outline: none;
    transition: border-color 0.2s, box-shadow 0.2s;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0, 59, 92, 0.10);
}

select:disabled {
    background: #f1f5f9;
    color: #94a3b8;
    cursor: not-allowed;
}

input.verified-field,
select.verified-field:disabled {
    background: #f1f7f4;
    border-color: #b7d7c5;
    color: var(--text);
    opacity: 1;
}

.verified-hint {
    margin: -10px 0 18px;
    color: #276749;
    font-size: 13px;
    font-weight: 600;
}

#btnReintentarDatosCorporativos {
    margin: -8px 0 18px;
}

.readonly-group {
    margin-bottom: 22px;
}

.readonly-group .field:last-child {
    margin-bottom: 0;
}

.turno-label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 8px;
}

.turno-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 10px;
}

.turno-chip {
    position: relative;
    margin: 0;
    cursor: pointer;
}

.turno-chip input {
    position: absolute;
    opacity: 0;
    pointer-events: none;
}

.turno-chip span {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #fff;
    color: var(--text);
    font-weight: 600;
    padding: 10px 12px;
    text-align: center;
    transition: border-color 0.2s, box-shadow 0.2s, background-color 0.2s;
}

.turno-chip:hover span {
    border-color: var(--primary);
}

.turno-chip input:focus-visible + span {
    outline: 3px solid #7aa6d1;
    outline-offset: 2px;
}

.turno-chip input:checked + span {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

small {
    display: block;
    margin-top: 7px;
    color: var(--text-secondary);
    font-size: 12px;
}

/* TIPOS DE SITUACIÓN */

.situation-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.situation-card {
    position: relative;
    border: 2px solid var(--border);
    border-radius: var(--radius);
    padding: 18px;
    cursor: pointer;
    transition: 0.2s;
    background: white;
    min-width: 0;
}

.situation-card:hover {
    border-color: var(--primary);
    transform: translateY(-2px);
}

.situation-card.selected {
    border-color: var(--primary);
    background: var(--primary-light);
    box-shadow: 0 0 0 1px var(--primary);
}

.situation-card-label {
    display: block;
    margin: 0;
    font-weight: 400;
    cursor: pointer;
}

.situation-card-heading {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.situation-card h3 {
    font-size: 16px;
    margin: 0;
    color: var(--qhse-blueberry);
}

.situation-radio {
    width: 19px;
    height: 19px;
    flex: 0 0 19px;
    margin: 0;
    padding: 0;
    border-radius: 50%;
    accent-color: var(--qhse-blue);
    cursor: pointer;
}

.situation-radio:focus-visible,
.situation-examples-toggle:focus-visible {
    outline: 3px solid #7aa6d1;
    outline-offset: 3px;
}

.situation-card .situation-definition {
    color: var(--text-secondary);
    font-size: 13px;
    line-height: 1.55;
}

.situation-examples-preview,
.situation-examples-more {
    margin: 12px 0 0 28px;
    color: var(--text-secondary);
    font-size: 12px;
    line-height: 1.5;
}

.situation-examples-preview li,
.situation-examples-more li {
    margin: 3px 0;
}

.situation-examples-toggle {
    margin: 10px 0 0 28px;
    padding: 4px 0;
    border: 0;
    background: transparent;
    color: var(--qhse-blue);
    font: inherit;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
}

.situation-card .situation-examples-more[hidden] {
    display: none;
}

@media (min-width: 701px) {
    .situation-card:not(.examples-open) .situation-examples-more {
        display: none;
    }
}

@media (max-width: 700px) {
    .situation-card:not(.examples-open) .situation-examples-preview {
        display: none;
    }
}

/* BOTONES */

.form-actions {
    padding: 32px 46px 42px;
}

.primary-button,
.secondary-button {
    width: 100%;
    border: none;
    border-radius: 10px;
    padding: 14px 22px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    transition: 0.2s;
}

.primary-button {
    background: var(--primary);
    color: white;
}

.primary-button:hover {
    background: var(--qhse-blueberry);
}

.primary-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.secondary-button {
    background: var(--primary-light);
    color: var(--primary);
}

.secondary-button:hover {
    background: #daeaf1;
}

/* MENSAJES */

.message {
    padding: 14px;
    border-radius: 10px;
    margin-bottom: 18px;
    font-size: 14px;
}

.message.error {
    background: #ffebee;
    color: var(--error);
    border: 1px solid #ffcdd2;
}

/* CONFIRMACIÓN */

.confirmation {
    padding: 55px 46px;
    text-align: center;
}

.confirmation-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    margin: 0 auto 20px;
    background: var(--accent);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 32px;
    font-weight: 700;
}

.confirmation h2 {
    font-size: 27px;
    margin-bottom: 8px;
}

.confirmation > p {
    color: var(--text-secondary);
}

.folio-box {
    background: var(--background);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 24px;
    margin: 28px 0 10px;
}

.folio-box span {
    display: block;
    color: var(--text-secondary);
    font-size: 13px;
    margin-bottom: 5px;
}

.folio-box strong {
    color: var(--primary);
    font-size: 25px;
    letter-spacing: 1px;
}

.folio-help {
    font-size: 13px;
    margin-bottom: 28px;
}

/* MOBILE */

@media (max-width: 700px) {

    .form-header {
        padding: 28px 20px;
    }

    .form-header h1 {
        font-size: 25px;
    }

    .form-header p {
        font-size: 15px;
    }

    .form-header .intro {
        font-size: 14px;
    }

    .form-section {
        padding: 26px 20px;
    }

    .form-actions {
        padding: 24px 20px 32px;
    }

    .situation-grid {
        grid-template-columns: 1fr;
    }

    .turno-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .situation-card {
        min-height: 76px;
        padding: 18px;
    }

    .confirmation {
        padding: 40px 20px;
    }
}


/* ========================================
   TABLET / ESCRITORIO
   ======================================== */

@media (min-width: 768px) {

    .page-container {
        padding: 40px 24px;
    }

    .form-card {
        max-width: 820px;
        border-radius: 20px;
        box-shadow: 0 10px 35px rgba(0, 0, 0, 0.08);
    }

}

input,
select,
textarea {
    min-height: 50px;
}

textarea {
    min-height: 120px;
}

.primary-button,
.secondary-button {
    min-height: 54px;
}

/* ========================================
   EVIDENCIA FOTOGRÁFICA
   ======================================== */

.photo-help {
    color: var(--text-secondary);
    font-size: 14px;
    margin-bottom: 18px;
}

.photo-upload {
    display: flex;
    align-items: center;
    gap: 14px;
    flex-wrap: wrap;
}

.photo-button {
    min-height: 52px;
    border: 2px dashed var(--primary);
    border-radius: 12px;
    background: var(--primary-light);
    color: var(--primary);
    font-family: inherit;
    font-size: 15px;
    font-weight: 700;
    padding: 12px 20px;
    cursor: pointer;
}

.photo-button:hover {
    background: #dcecf3;
}

.photo-button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.photo-counter {
    color: var(--text-secondary);
    font-size: 14px;
    font-weight: 600;
}

.photo-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    margin-top: 20px;
}

.photo-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 12px;
    overflow: hidden;
    background: #e2e8f0;
    border: 1px solid var(--border);
}

.photo-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-remove {
    position: absolute;
    top: 7px;
    right: 7px;

    width: 32px;
    height: 32px;

    border: none;
    border-radius: 50%;

    background: rgba(0, 0, 0, 0.72);
    color: white;

    font-size: 18px;
    font-weight: 700;

    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 700px) {

    .photo-upload {
        display: block;
    }

    .photo-button {
        width: 100%;
    }

    .photo-counter {
        display: block;
        margin-top: 10px;
        text-align: center;
    }

    .photo-preview {
        grid-template-columns: repeat(2, 1fr);
    }
}

.evidence-result {
    margin: 18px 0 26px;

    padding: 14px;

    border-radius: 10px;

    font-size: 13px;

    text-align: left;
}

.evidence-success {
    color: #166534;

    background: #dcfce7;

    border: 1px solid #bbf7d0;
}

.evidence-warning {
    color: #92400e;

    background: #fef3c7;

    border: 1px solid #fde68a;
}

/* ========================================
   PROGRESO DE ENVÍO
   ======================================== */

.upload-progress {
    margin-bottom: 20px;

    padding: 16px;

    background: #f8fafc;

    border: 1px solid var(--border);

    border-radius: 12px;
}

.upload-progress-header {
    display: flex;

    align-items: center;
    justify-content: space-between;

    gap: 12px;

    margin-bottom: 10px;

    font-size: 13px;
}

.upload-progress-header span {
    font-weight: 600;
}

.upload-progress-header strong {
    color: var(--primary);
}

.upload-progress-track {
    width: 100%;
    height: 9px;

    background: #e2e8f0;

    border-radius: 20px;

    overflow: hidden;
}

.upload-progress-bar {
    width: 0%;
    height: 100%;

    background: var(--primary);

    border-radius: 20px;

    transition: width 0.3s ease;
}

.upload-progress small {
    margin-top: 9px;
}

/* ========================================
   WELCOME QHSE
   ======================================== */

.welcome-page {
    min-height: 100vh;

    display: flex;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: linear-gradient(140deg, var(--qhse-blueberry), var(--qhse-blue-mid), var(--qhse-blue));
}


.welcome-card {
    width: 100%;
    max-width: 1040px;
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(340px, 0.9fr);
    align-items: center;
    gap: clamp(24px, 5vw, 64px);
}


.welcome-brand {
    padding: 28px 0;
    color: white;
}

.welcome-logo {
    display: block;
    width: min(100%, 300px);
    height: auto;
    object-fit: contain;
    margin: 0 0 32px;
}


.welcome-brand h1 {
    font-size: clamp(38px, 5vw, 58px);
    line-height: 1.05;
    margin-bottom: 10px;
    letter-spacing: -0.03em;
}


.welcome-brand p {
    line-height: 1.6;
}

.welcome-subtitle {
    font-size: 16px;
    font-weight: 700;
}


.welcome-description {
    margin-top: 14px;
    max-width: 540px;
    color: rgba(255, 255, 255, 0.88);
    font-size: 15px;
}


.welcome-access {
    padding: clamp(26px, 4vw, 42px);
    background: var(--surface);
    border-radius: 20px;
    box-shadow: 0 20px 55px rgba(5, 13, 34, 0.25);
}


.welcome-access h2 {
    font-size: 19px;

    margin-bottom: 20px;
}


.welcome-option {
    width: 100%;

    display: block;

    text-align: left;

    margin-bottom: 12px;

    padding: 18px 20px;

    background: white;

    border: 1px solid var(--border);

    border-radius: 12px;

    cursor: pointer;

    transition: 0.2s;
    font-family: inherit;
}


.welcome-option:hover {
    border-color: var(--primary);

    background: var(--primary-light);
}

.welcome-option:focus-visible {
    outline: 3px solid #7aa6d1;
    outline-offset: 3px;
}

.welcome-option:first-of-type {
    border-color: var(--qhse-blue);
    background: var(--qhse-blue);
}

.welcome-option:first-of-type strong,
.welcome-option:first-of-type span {
    color: #ffffff;
}

.welcome-option:first-of-type:hover {
    border-color: var(--qhse-blueberry);
    background: var(--qhse-blueberry);
}


.welcome-option strong {
    display: block;

    color: var(--text);

    font-size: 15px;

    margin-bottom: 4px;
}


.welcome-option span {
    color: var(--text-secondary);

    font-size: 13px;
}


.welcome-option-guest {
    border: 1px solid var(--qhse-blueberry);
    background: #ffffff;
}

.welcome-option-guest strong {
    color: var(--qhse-blueberry);
}


@media (max-width: 700px) {

    .welcome-page {
        padding: 24px 16px;
    }

    .welcome-card {
        max-width: 520px;
        grid-template-columns: 1fr;
        gap: 12px;
    }

    .welcome-brand {
        padding: 18px 8px 22px;
    }

    .welcome-brand h1 {
        font-size: 40px;
    }

    .welcome-logo {
        width: min(72%, 260px);
        margin-bottom: 24px;
    }

    .welcome-access {
        padding: 24px 20px;
    }

    .welcome-option {
        min-height: 76px;
    }
}

/* ========================================
   GUARDAR PERFIL INVITADO
   ======================================== */

.save-profile-option {
    margin-top: 18px;
}

.save-profile-check {
    display: flex;
    align-items: flex-start;

    gap: 12px;

    padding: 15px 16px;

    background: #f8fafc;

    border: 1px solid var(--border);

    border-radius: 10px;

    cursor: pointer;
}

.save-profile-check:hover {
    border-color: var(--primary);
}

.save-profile-check input {
    width: 19px;
    height: 19px;

    min-height: auto;

    margin-top: 2px;

    flex-shrink: 0;

    accent-color: var(--primary);
}

.save-profile-check span {
    display: block;
}

.save-profile-check strong {
    display: block;

    font-size: 14px;

    margin-bottom: 4px;
}

.save-profile-check small {
    display: block;

    color: var(--text-secondary);

    font-size: 12px;

    line-height: 1.45;
}

.external-pending,
.post-report-registration {
    margin: 20px 0;
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: #f8fafc;
}

.admin-shortcut {
    margin: 0 0 12px;
    text-align: right;
    font-size: 13px;
}

.external-pending h2,
.post-report-registration h3 {
    margin-top: 0;
}

.turnstile-widget {
    display: flex;
    justify-content: center;
    margin-bottom: 16px;
}

.turnstile-widget[hidden] {
    display: none;
}
