/* Página de contacto — coherente con portal candidato (--salle-blue, --bg-input, btn-send) */

/* modal-oferta.css fuerza display:flex en .modal; ocultar modal Bootstrap cerrado */
#modalContactoLegal.modal.fade:not(.show) {
    display: none !important;
    pointer-events: none !important;
    background-color: transparent !important;
}

.contacto-modal-direccion {
    color: var(--salle-blue, #202c64);
    font-weight: bold;
}


/* Pie legal a ancho completo de ventana (escapa márgenes de .main) */
body.validado:has(.contacto-info-footer),
body.bg-candidato:has(.contacto-info-footer),
body.bg-backoffice:has(.contacto-info-footer) {
    padding-bottom: 2.75rem;
}


.footer.contacto-pie-validado,
.footer.contacto-pie-admin,
.footer.pie-guest {
    display: block !important;
    position: fixed !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    width: 100vw !important;
    max-width: 100vw !important;
    margin: 0 !important;
    flex-shrink: 0;
    z-index: 100;
    box-sizing: border-box;
}

.contacto-info-footer {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0;
}

.contacto-page {
    width: 100%;
    min-height: 0;
    padding: 1rem 1rem 0.5rem;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    box-sizing: border-box;
    flex: 1;
}

.contacto-page__inner {
    width: 100%;
    max-width: 560px;
    margin: 0 auto;
}

.contacto-card {
    background: #fff;
    border: 1px solid rgba(32, 44, 100, 0.1);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(32, 44, 100, 0.08);
    padding: 1.25rem 1.25rem 1rem;
    transition: box-shadow 0.25s ease;
}

.contacto-card:hover {
    box-shadow: 0 12px 40px rgba(32, 44, 100, 0.12);
}

.contacto-back {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    color: var(--salle-blue, #202c64);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
    transition: color 0.2s ease;
}

.contacto-form {
    margin-top: 2.5rem;
}

.contacto-alert + .contacto-form {
    margin-top: 1.25rem;
}

.contacto-back:hover {
    color: #0b4c86;
    text-decoration: none;
}

.contacto-back .fa {
    font-size: 1.1rem;
}

.contacto-logo {
    text-align: center;
    margin-bottom: 0.5rem;
}

.contacto-logo img {
    max-width: 180px;
    width: 100%;
    height: auto;
}

.contacto-page--validado .contacto-logo,
.contacto-page--admin .contacto-logo {
    display: none;
}

.contacto-header {
    text-align: center;
    margin-bottom: 0.65rem;
}

.contacto-header h1 {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--salle-blue, #202c64);
    margin: 0 0 0.2rem;
    line-height: 1.2;
}

.contacto-lead {
    font-size: 0.85rem;
    color: #5c5c5c;
    margin: 0;
    line-height: 1.35;
}

.contacto-alert {
    border-radius: 8px;
    padding: 0.5rem 0.75rem;
    margin-bottom: 0.5rem;
    font-size: 0.85rem;
    line-height: 1.35;
}

.contacto-alert--error {
    background: #fde8e8;
    color: #9b1c1c;
    border: 1px solid #f5c6c6;
}

.contacto-alert--success {
    background: #e8f5e9;
    color: #1b5e20;
    border: 1px solid #c8e6c9;
}

.contacto-form__row {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.contacto-form .form-group {
    margin-bottom: 0.55rem;
}

.contacto-form label {
    display: block;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--salle-blue, #202c64);
    margin-bottom: 0.25rem;
}

.contacto-form .form-control {
    width: 100%;
    background: var(--bg-input, #f0f0f0);
    border: none;
    border-radius: 8px;
    padding: 0.45rem 0.7rem !important;
    height: auto !important;
    min-height: 41px;
    font-size: 0.9rem;
    color: rgba(26, 22, 61, 0.88);
    transition: box-shadow 0.2s ease;
    box-sizing: border-box;
}

.contacto-form textarea.form-control {
    min-height: 160px;
    max-height: 240px;
    resize: vertical;
    line-height: 1.35;
}

.contacto-form .form-control:focus {
    border: none !important;
    box-shadow: 0 0 0 2px rgba(32, 44, 100, 0.25) !important;
    outline: none;
    color: rgba(26, 22, 61, 0.95);
    background: var(--bg-input, #f0f0f0);
}

.contacto-form .form-control::placeholder {
    color: #9ca3af;
}

.contacto-legal {
    margin: 1.25rem 0;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #374151;
}

.contacto-legal label {
    display: flex;
    align-items: flex-start;
    gap: 0.4rem;
    font-weight: 400;
    cursor: pointer;
    margin: 0;
}

.contacto-legal input[type="checkbox"] {
    margin-top: 0.15rem;
    flex-shrink: 0;
    accent-color: var(--salle-blue, #202c64);
}

.contacto-legal-link {
    font-weight: 700;
    color: var(--salle-blue, #202c64);
    cursor: pointer;
    text-decoration: underline;
}

.contacto-legal-link:hover {
    color: #0b4c86;
}

.contacto-captcha {
    margin: 0.5rem 0;
    padding: 0.65rem 0.75rem;
    background: var(--bg-input, #f0f0f0);
    border-radius: 8px;
    border: none;
}

.contacto-captcha__row {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 0.5rem;
}

.contacto-captcha__img-wrap {
    flex-shrink: 0;
}

.contacto-captcha__img-wrap img {
    display: block;
    border-radius: 4px;
    height: 40px;
    width: auto;
    background: #fff;
}

.contacto-captcha__refresh {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    border: none;
    background: var(--salle-blue, #202c64);
    color: #fff;
    border-radius: 8px;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.contacto-captcha__refresh:hover {
    filter: brightness(85%);
}

.contacto-captcha__field {
    flex: 1;
    min-width: 120px;
}

.contacto-captcha__hint {
    display: block;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--salle-blue, #202c64);
    margin: 0 0 0.2rem;
    line-height: 1.2;
}

.contacto-captcha__field .form-control {
    min-height: 36px;
    background: #fff !important;
    border: 1px solid #c4c4c4 !important;
    border-radius: 8px;
    font-size: 0.8rem;
}

.contacto-captcha__field .form-control::placeholder {
    font-size: 0.75rem;
}

.contacto-captcha__field .form-control:focus {
    background: #fff !important;
    border-color: #9ca3af !important;
    box-shadow: 0 0 0 2px rgba(32, 44, 100, 0.15) !important;
}

.contacto-actions {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 0.75rem;
}

.contacto-form .btn-send {
    width: auto;
    min-width: 10rem;
    max-width: 100%;
    min-height: 42px;
    margin: 0 !important;
    padding: 0.65rem 2rem;
    font-size: 0.95rem;
    font-weight: bold;
    border-radius: 8px;
    border: none;
    cursor: pointer;
    background-color: #9384dd !important;
    color: #fff !important;
    transition: background-color 0.2s ease-in-out;
}

.contacto-form .btn-send:hover {
    background-color: #7768c2 !important;
}

.contacto-form .btn-send:disabled {
    opacity: 0.65;
    cursor: not-allowed;
}

.contacto-page--admin .contacto-page__inner {
    max-width: 600px;
}

/* Desktop: formulario + pie visibles sin scroll */
@media (min-width: 1024px) {
    body.bg-candidato:has(.contacto-info-footer),
    body.validado:has(.contacto-info-footer) {
        height: 100vh;
        max-height: 100vh;
        overflow: hidden;
        display: flex;
        flex-direction: column;
        box-sizing: border-box;
    }

    body.bg-candidato .main-container:has(.contacto-info-footer),
    body.validado .main-container:has(.contacto-info-footer) {
        flex: 1;
        min-height: 0;
        height: auto !important;
        max-height: none;
        overflow: hidden;
        box-sizing: border-box;
    }

    body.bg-candidato .main:has(.contacto-info-footer),
    body.validado .main:has(.contacto-info-footer) {
        flex: 1;
        min-height: 0;
        display: flex;
        flex-direction: column;
        overflow: hidden;
    }

    .contacto-info-footer {
        flex: 1;
        min-height: 0;
        overflow: hidden;
    }

    .contacto-page {
        flex: 1;
        min-height: 0;
        padding: 0.35rem 1rem 0.25rem;
        align-items: center;
        overflow: hidden;
    }

    .contacto-page__inner {
        max-width: 500px;
        height: 100%;
        display: flex;
        align-items: center;
    }

    .contacto-card {
        width: 100%;
        padding: 0.75rem 1rem 0.65rem;
        border-radius: 12px;
    }

    .contacto-back {
        margin-bottom: 0.75rem;
        font-size: 0.8rem;
    }

    .contacto-form {
        margin-top: 2rem;
    }

    .contacto-alert + .contacto-form {
        margin-top: 1rem;
    }

    .contacto-logo {
        margin-bottom: 0.25rem;
    }

    .contacto-logo img {
        max-width: 130px;
    }

    .contacto-page--validado .contacto-header,
    .contacto-page--admin .contacto-header {
        margin-bottom: 0.4rem;
    }

    .contacto-header {
        margin-bottom: 0.35rem;
    }

    .contacto-header h1 {
        font-size: 1.05rem;
    }

    .contacto-lead {
        font-size: 0.75rem;
    }

    .contacto-form__row {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0 0.65rem;
    }

    .contacto-form__row .form-group {
        margin-bottom: 0.4rem;
    }

    .contacto-form .form-group {
        margin-bottom: 0.4rem;
    }

    .contacto-form .form-control {
        min-height: 38px;
        padding: 0.35rem 0.6rem !important;
        font-size: 0.85rem;
    }

    .contacto-form textarea.form-control {
        min-height: 100px;
        max-height: 140px;
    }

    .contacto-legal {
        margin: 1.25rem 0;
        font-size: 0.72rem;
    }

    .contacto-captcha {
        margin: 0.35rem 0;
        padding: 0.45rem 0.55rem;
    }

    .contacto-captcha__row {
        flex-wrap: nowrap;
        align-items: center;
        gap: 0.4rem;
    }

    .contacto-captcha__field {
        min-width: 0;
    }

    .contacto-captcha__hint {
        font-size: 0.68rem;
        margin-bottom: 0.15rem;
    }

    .contacto-captcha__field .form-control {
        min-height: 32px;
    }

    .contacto-actions {
        margin-top: 20px;
    }

    .contacto-actions {
        display:flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
    }

    .contacto-actions input {
        width: auto !important;
        min-width: 10rem;
    }

    .contacto-form .btn-send {
        min-height: 38px;
        font-size: 0.9rem;
        border-radius: 8px;
    }

    .footer.contacto-pie-validado,
    .footer.contacto-pie-admin,
    .footer.pie-guest {
        flex-shrink: 0;
        padding: 4px 10px;
    }

    .footer.contacto-pie-validado .footer-legal-content .txt,
    .footer.contacto-pie-validado a.txt,
    .footer.pie-guest .footer-legal-content .txt,
    .footer.pie-guest a.txt,
    .footer.contacto-pie-admin .footer-legal-content .txt,
    .footer.contacto-pie-admin a.txt {
        font-size: 12px !important;
    }
}

/* Pantallas de poca altura (portátiles) */
@media (min-width: 1024px) and (max-height: 800px) {
    .contacto-logo img {
        max-width: 110px;
    }

    .contacto-header h1 {
        font-size: 0.95rem;
    }

    .contacto-lead {
        display: none;
    }

    .contacto-form textarea.form-control {
        min-height: 80px;
        max-height: 100px;
    }

    .contacto-card {
        padding: 0.45rem 0.85rem 0.35rem;
    }
}

@media (max-width: 1023px) {
    .contacto-form__row .form-group + .form-group {
        margin-top: 0;
    }
}

@media (max-width: 576px) {
    .contacto-page {
        padding: 0.75rem 0.75rem 0.5rem;
    }

    .contacto-card {
        padding: 1rem 0.85rem 0.85rem;
        border-radius: 12px;
    }

    .contacto-header h1 {
        font-size: 1.15rem;
    }

    .contacto-form textarea.form-control {
        min-height: 140px;
        max-height: none;
    }

    .contacto-captcha__row {
        flex-direction: row;
        align-items: flex-end;
    }
    
  
}
