/**
 * HR Public Vacancies — Estilos del portal público de vacantes.
 *
 * Bloque raíz: .hrpv (HR Public Vacancies)
 * Standalone (sin chrome WES). Diseño limpio orientado a candidatos externos.
 *
 * Reglas seguidas (ver CSS-BEST-PRACTICES.md):
 *   - BEM estricto, sin !important, sin estilos inline en templates
 *   - Clases de estado con prefijo `is-` (.is-hidden, .is-invisible)
 *   - JS solo togglea clases, nunca setea display/visibility inline
 */

/* ============================================
   ESTADOS COMPARTIDOS (no usar inline display:none/visibility:hidden)
   ============================================ */
.hrpv .is-hidden    { display: none; }
.hrpv .is-invisible { visibility: hidden; }

* { box-sizing: border-box; }

html, body {
    margin: 0;
    padding: 0;
}

body.hrpv {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
    color: #1e293b;
    background: #f8fafc;
    min-height: 100vh;

    display: flex;
    flex-direction: column;
}

/* =========================================================================
   HEADER
   ========================================================================= */
.hrpv__header {
    background: linear-gradient(135deg, #1e3a8a 0%, #1e40af 100%);
    color: #fff;
    padding: 28px 0;
}

.hrpv__header-inner {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 24px;

    display: flex;
    align-items: center;
    gap: 24px;
}

.hrpv__logo {
    width: 64px;
    height: auto;
    flex: 0 0 auto;
}

.hrpv__logo--small {
    width: 48px;
}

.hrpv__title {
    margin: 0;
    font-size: 28px;
    font-weight: 800;
    letter-spacing: -0.5px;
}

.hrpv__subtitle {
    margin: 4px 0 0;
    font-size: 15px;
    opacity: 0.85;
}

.hrpv__back {
    color: rgba(255, 255, 255, 0.9);
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;

    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-right: auto;
}

.hrpv__back:hover {
    color: #fff;
    text-decoration: underline;
}

/* =========================================================================
   MAIN
   ========================================================================= */
.hrpv__main {
    flex: 1;
    max-width: 1100px;
    width: 100%;
    margin: 0 auto;
    padding: 32px 24px 64px;
}

/* =========================================================================
   LISTADO DE VACANTES
   ========================================================================= */
.hrpv__count {
    margin-bottom: 16px;
    color: #64748b;
    font-size: 14px;
}

.hrpv__count strong {
    color: #1e293b;
}

.hrpv__grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 20px;
}

.hrpv__card {
    position: relative;
    display: block;

    padding: 24px;
    text-decoration: none;
    color: inherit;

    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;

    transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}

.hrpv__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 16px 40px rgba(15, 23, 42, 0.08);
    border-color: #93c5fd;
}

.hrpv__badge {
    position: absolute;
    top: 16px;
    right: 16px;
    padding: 4px 10px;

    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.4px;
    text-transform: uppercase;

    border-radius: 999px;
}

.hrpv__badge--urgent {
    color: #991b1b;
    background: #fee2e2;
}

.hrpv__card-title {
    margin: 0 0 12px;
    font-size: 19px;
    font-weight: 700;
    color: #0f172a;
    padding-right: 80px;
}

.hrpv__card-meta {
    list-style: none;
    padding: 0;
    margin: 0 0 12px;

    display: flex;
    flex-wrap: wrap;
    gap: 8px 14px;
}

.hrpv__card-meta li {
    font-size: 13px;
    color: #475569;

    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.hrpv__card-meta i {
    color: #64748b;
}

.hrpv__card-desc {
    font-size: 14px;
    line-height: 1.55;
    color: #475569;
    margin: 0 0 16px;
}

.hrpv__card-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;

    font-size: 14px;
    font-weight: 600;
    color: #2563eb;
}

.hrpv__card-deadline {
    display: block;
    margin-top: 12px;

    font-size: 12px;
    color: #92400e;

    padding-top: 12px;
    border-top: 1px dashed #e2e8f0;
}

/* =========================================================================
   EMPTY STATE
   ========================================================================= */
.hrpv__empty {
    background: #fff;
    border-radius: 16px;
    padding: 56px 24px;
    text-align: center;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.hrpv__empty i {
    font-size: 48px;
    color: #cbd5e1;
    margin-bottom: 16px;
}

.hrpv__empty h2 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #1e293b;
}

.hrpv__empty p {
    margin: 0;
    color: #64748b;
}

/* =========================================================================
   DETALLE DE VACANTE
   ========================================================================= */
.hrpv__detail {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.hrpv__detail-head {
    padding-bottom: 24px;
    border-bottom: 1px solid #e2e8f0;
}

.hrpv__detail-title {
    margin: 0 0 16px;
    font-size: 30px;
    font-weight: 800;
    color: #0f172a;
    line-height: 1.2;
}

.hrpv__detail-meta {
    list-style: none;
    padding: 0;
    margin: 0;

    display: flex;
    flex-wrap: wrap;
    gap: 10px 18px;
}

.hrpv__detail-meta li {
    font-size: 14px;
    color: #475569;

    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.hrpv__detail-meta i {
    color: #2563eb;
}

.hrpv__detail-block {
    padding: 24px 0;
    border-bottom: 1px solid #e2e8f0;
}

.hrpv__detail-block:last-child {
    border-bottom: none;
}

.hrpv__detail-block--cta {
    text-align: center;
    padding-top: 32px;
}

.hrpv__detail-h2 {
    margin: 0 0 12px;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.hrpv__detail-body {
    font-size: 15px;
    line-height: 1.65;
    color: #334155;
}

.hrpv__detail-body p {
    margin: 0 0 12px;
}

.hrpv__detail-deadline {
    margin-top: 16px;
    color: #92400e;
    font-size: 13px;
}

/* =========================================================================
   BOTONES
   ========================================================================= */
.hrpv__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    padding: 12px 24px;

    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    text-align: center;

    border: none;
    border-radius: 10px;
    cursor: pointer;

    transition: transform 0.12s ease, box-shadow 0.12s ease, background 0.12s ease;
}

.hrpv__btn--primary {
    color: #fff;
    background: #2563eb;
    box-shadow: 0 8px 20px rgba(37, 99, 235, 0.25);
}

.hrpv__btn--primary:hover {
    background: #1d4ed8;
    transform: translateY(-1px);
}

.hrpv__btn--secondary {
    color: #1e293b;
    background: #fff;
    border: 1px solid #cbd5e1;
}

.hrpv__btn--secondary:hover {
    background: #f1f5f9;
}

.hrpv__btn--success {
    color: #fff;
    background: #16a34a;
    box-shadow: 0 8px 20px rgba(22, 163, 74, 0.25);
}

.hrpv__btn--success:hover {
    background: #15803d;
}

.hrpv__btn--lg {
    padding: 16px 32px;
    font-size: 15px;
}

/* =========================================================================
   FORMULARIO MULTI-STEP
   ========================================================================= */
.hrpv__form-section {
    background: #fff;
    border-radius: 16px;
    padding: 36px;
    margin-top: 24px;
    box-shadow: 0 8px 24px rgba(15, 23, 42, 0.04);
}

.hrpv__form-head {
    text-align: center;
    margin-bottom: 24px;
}

.hrpv__form-title {
    margin: 0 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.hrpv__form-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

.hrpv__honeypot {
    position: absolute;
    left: -10000px;
    top: -10000px;
    height: 0;
    width: 0;
    opacity: 0;
}

/* Progress */
.hrpv__progress {
    margin: 24px 0 32px;
}

.hrpv__progress-bar {
    height: 4px;
    background: #e2e8f0;
    border-radius: 2px;
    overflow: hidden;
    margin-bottom: 16px;
}

.hrpv__progress-fill {
    height: 100%;
    background: linear-gradient(90deg, #2563eb, #06b6d4);
    width: 0%;
    transition: width 0.3s ease;
}

/* Anchos por paso (form de 4 pasos: 0%, 33%, 66%, 100%) */
.hrpv__progress-fill--step-1 { width: 0%; }
.hrpv__progress-fill--step-2 { width: 33.33%; }
.hrpv__progress-fill--step-3 { width: 66.66%; }
.hrpv__progress-fill--step-4 { width: 100%; }

.hrpv__progress-steps {
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.hrpv__progress-step {
    flex: 1;
    text-align: center;
}

.hrpv__progress-step-circle {
    width: 36px;
    height: 36px;
    margin: 0 auto 6px;

    display: flex;
    align-items: center;
    justify-content: center;

    color: #94a3b8;
    background: #f1f5f9;
    border: 2px solid #e2e8f0;
    border-radius: 50%;

    transition: all 0.2s ease;
}

.hrpv__progress-step--active .hrpv__progress-step-circle {
    color: #fff;
    background: #2563eb;
    border-color: #2563eb;
}

.hrpv__progress-step--done .hrpv__progress-step-circle {
    color: #fff;
    background: #16a34a;
    border-color: #16a34a;
}

.hrpv__progress-step-label {
    font-size: 12px;
    color: #64748b;
}

.hrpv__progress-step--active .hrpv__progress-step-label {
    color: #1e293b;
    font-weight: 600;
}

/* Steps */
.hrpv__step {
    display: none;
}

.hrpv__step--active {
    display: block;
}

.hrpv__step-header {
    margin-bottom: 24px;
    padding-bottom: 12px;
    border-bottom: 1px dashed #e2e8f0;
}

.hrpv__step-number {
    font-size: 12px;
    font-weight: 600;
    color: #2563eb;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrpv__step-title {
    margin: 4px 0 4px;
    font-size: 22px;
    font-weight: 700;
    color: #0f172a;
}

.hrpv__step-subtitle {
    margin: 0;
    color: #64748b;
    font-size: 14px;
}

/* Fields */
.hrpv__field {
    margin-bottom: 16px;
}

.hrpv__field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.hrpv__label {
    display: block;
    margin-bottom: 6px;

    font-size: 13px;
    font-weight: 600;
    color: #334155;
}

.hrpv__field--required .hrpv__label::after {
    content: ' *';
    color: #dc2626;
}

.hrpv__field-hint {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #94a3b8;
}

.hrpv__input,
.hrpv__select,
.hrpv__textarea {
    width: 100%;
    padding: 11px 14px;

    font-family: inherit;
    font-size: 14px;
    color: #1e293b;

    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 8px;

    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.hrpv__input:focus,
.hrpv__select:focus,
.hrpv__textarea:focus {
    outline: none;
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

.hrpv__input--error,
.hrpv__select--error {
    border-color: #dc2626;
    background: #fef2f2;
}

.hrpv__textarea {
    resize: vertical;
    min-height: 80px;
}

.iti {
    width: 100%;
}

/* Upload card */
.hrpv__upload-card {
    margin-bottom: 16px;
    padding: 20px;
    background: #f8fafc;
    border: 1px dashed #cbd5e1;
    border-radius: 12px;
}

.hrpv__upload-header {
    display: flex;
    gap: 12px;
    margin-bottom: 12px;
    align-items: flex-start;
}

.hrpv__upload-header > i {
    font-size: 22px;
    color: #2563eb;
    margin-top: 4px;
}

.hrpv__upload-title {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 700;
    color: #1e293b;
}

.hrpv__upload-desc {
    margin: 0;
    font-size: 13px;
    color: #64748b;
}

.hrpv__upload-dropzone {
    position: relative;
    padding: 24px;
    text-align: center;

    background: #fff;
    border: 2px dashed #cbd5e1;
    border-radius: 10px;

    cursor: pointer;
    transition: all 0.15s ease;
}

.hrpv__upload-dropzone:hover,
.hrpv__upload-dropzone--dragging {
    border-color: #2563eb;
    background: #eff6ff;
}

.hrpv__upload-input {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
}

.hrpv__upload-idle {
    color: #64748b;
}

.hrpv__upload-idle i {
    display: block;
    font-size: 28px;
    color: #94a3b8;
    margin-bottom: 8px;
}

.hrpv__upload-idle span {
    display: block;
    font-weight: 600;
    color: #1e293b;
}

.hrpv__upload-idle small {
    display: block;
    margin-top: 4px;
    color: #94a3b8;
    font-size: 12px;
}

.hrpv__upload-done {
    display: none;
    align-items: center;
    gap: 12px;
    text-align: left;
}

.hrpv__upload-dropzone--has-file .hrpv__upload-idle {
    display: none;
}

.hrpv__upload-dropzone--has-file .hrpv__upload-done {
    display: flex;
}

.hrpv__upload-done > i {
    font-size: 28px;
    color: #16a34a;
    flex: 0 0 auto;
}

.hrpv__upload-done > div {
    flex: 1;
    min-width: 0;
}

.hrpv__upload-done strong {
    display: block;
    color: #1e293b;
    font-size: 14px;
}

.hrpv__upload-filename {
    display: block;
    color: #64748b;
    font-size: 12px;
    word-break: break-all;
}

.hrpv__upload-replace {
    background: transparent;
    color: #2563eb;
    border: 1px solid #cbd5e1;
    padding: 6px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    font-weight: 600;
    flex: 0 0 auto;
}

.hrpv__upload-replace:hover {
    background: #f1f5f9;
}

.hrpv__upload-error {
    display: none;
    margin-top: 8px;
    padding: 8px 12px;
    color: #991b1b;
    background: #fee2e2;
    border-radius: 6px;
    font-size: 13px;
    text-align: left;
}

.hrpv__upload-error.is-visible {
    display: block;
}

/* Review */
.hrpv__review {
    margin: 24px 0;
    padding: 20px;
    background: #f8fafc;
    border-radius: 10px;
}

.hrpv__review-title {
    margin: 0 0 12px;
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrpv__review-list {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 6px 16px;
    margin: 0;
}

.hrpv__review-list dt {
    font-weight: 600;
    color: #64748b;
    font-size: 13px;
}

.hrpv__review-list dd {
    margin: 0;
    color: #1e293b;
    font-size: 13px;
    word-break: break-word;
}

.hrpv__review-cv {
    margin-top: 16px;
    padding: 10px 14px;

    color: #166534;
    background: #dcfce7;
    border-radius: 8px;

    font-size: 13px;
}

.hrpv__review-cv--missing {
    color: #92400e;
    background: #fef3c7;
}

/* Consent */
.hrpv__consent {
    margin: 16px 0;
    padding: 16px;
    background: #eff6ff;
    border-radius: 10px;
}

.hrpv__checkbox {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    cursor: pointer;
    font-size: 13px;
    color: #1e3a8a;
    line-height: 1.55;
}

.hrpv__checkbox input {
    margin-top: 3px;
    flex: 0 0 auto;
}

/* Navegación */
.hrpv__nav {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid #e2e8f0;
}

.hrpv__form-error {
    margin-top: 16px;
    padding: 12px 16px;

    color: #991b1b;
    background: #fee2e2;
    border-left: 4px solid #dc2626;
    border-radius: 8px;

    font-size: 14px;
}

/* Cuando is-hidden global no aplica (porque .hrpv__form-error tiene display block
   por defecto y la sección padre puede o no aplicar la regla genérica), usamos
   un override BEM por especificidad. */
.hrpv__form-error.is-hidden { display: none; }

/* =========================================================================
   SUCCESS / DUPLICATE
   ========================================================================= */
.hrpv__success {
    text-align: center;
    padding: 24px 0;
}

.hrpv__success-card {
    background: #fff;
    padding: 48px 32px;
    border-radius: 20px;
    box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);

    max-width: 560px;
    margin: 0 auto;
}

.hrpv__success-icon {
    font-size: 64px;
    color: #16a34a;
    margin-bottom: 16px;
}

.hrpv__success-icon--warning {
    color: #f59e0b;
}

.hrpv__success-title {
    margin: 0 0 16px;
    font-size: 26px;
    font-weight: 800;
    color: #0f172a;
}

.hrpv__success-message {
    margin: 0 0 16px;
    color: #475569;
    font-size: 15px;
    line-height: 1.6;
}

.hrpv__success-tracking {
    margin: 24px 0;
    padding: 16px;
    background: #f1f5f9;
    border-radius: 12px;
}

.hrpv__success-tracking-label {
    margin: 0 0 6px;
    font-size: 12px;
    color: #64748b;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.hrpv__success-tracking-link {
    color: #2563eb;
    word-break: break-all;
    font-size: 13px;
    font-weight: 600;
}

/* =========================================================================
   OVERLAY (loader fullscreen)
   ========================================================================= */
.hrpv__overlay {
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, 0.65);
    z-index: 9999;

    display: flex;
    align-items: center;
    justify-content: center;
}

.hrpv__overlay-content {
    background: #fff;
    padding: 32px 48px;
    border-radius: 16px;
    text-align: center;
}

.hrpv__overlay-content i {
    font-size: 32px;
    color: #2563eb;
    margin-bottom: 12px;
}

.hrpv__overlay-content p {
    margin: 0;
    color: #1e293b;
    font-weight: 600;
}

/* =========================================================================
   FOOTER
   ========================================================================= */
.hrpv__footer {
    padding: 24px;
    text-align: center;
    background: #f1f5f9;

    color: #64748b;
    font-size: 12px;
}

.hrpv__footer p {
    margin: 0;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 720px) {
    .hrpv__header-inner {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }

    .hrpv__title {
        font-size: 22px;
    }

    .hrpv__detail,
    .hrpv__form-section {
        padding: 24px 18px;
    }

    .hrpv__detail-title {
        font-size: 22px;
    }

    .hrpv__field-row,
    .hrpv__review-list {
        grid-template-columns: 1fr;
    }

    .hrpv__progress-step-label {
        display: none;
    }

    .hrpv__nav {
        flex-direction: column-reverse;
    }

    .hrpv__btn {
        width: 100%;
    }
}
