/* ============================================================
   CAMPETROL — Formulario Oportunidades
   Premium dark-corporate design
   ============================================================ */

/* ---------- RESET & BASE ---------- */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Brand */
    --blue-dark: #0a2540;
    --blue-mid: #1a6faf;
    --blue-light: #3fa3f5;
    --gold: #c8973a;
    --gold-light: #f0c060;

    /* Surface */
    --bg: #07182e;
    --surface: rgba(10, 37, 64, 0.72);
    --surface-2: rgba(255, 255, 255, 0.05);
    --border: rgba(255, 255, 255, 0.10);
    --border-focus: rgba(63, 163, 245, 0.55);

    /* Text */
    --text-primary: #e8f1fb;
    --text-secondary: #8baece;
    --text-muted: #4a6d8c;

    /* State */
    --success: #22c55e;
    --error: #ef4444;
    --warning: #f59e0b;

    /* Sizes */
    --radius-sm: 8px;
    --radius-md: 14px;
    --radius-lg: 22px;
    --radius-xl: 30px;

    --shadow-card: 0 24px 64px rgba(0, 0, 0, 0.55), 0 2px 8px rgba(0, 0, 0, 0.35);
    --shadow-glow: 0 0 40px rgba(26, 111, 175, 0.22);
}

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: 'Inter', system-ui, sans-serif;
    background-color: var(--bg);
    color: var(--text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    line-height: 1.6;
}

/* ---------- ANIMATED BACKGROUND ---------- */
.bg-canvas {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}

.bg-orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(80px);
    opacity: 0.35;
    animation: orbFloat 20s ease-in-out infinite alternate;
}

.orb-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, #1a6faf 0%, transparent 70%);
    top: -200px;
    left: -200px;
    animation-duration: 18s;
}

.orb-2 {
    width: 480px;
    height: 480px;
    background: radial-gradient(circle, #0d3d6b 0%, transparent 70%);
    bottom: -150px;
    right: -150px;
    animation-duration: 24s;
    animation-delay: -8s;
}

.orb-3 {
    width: 360px;
    height: 360px;
    background: radial-gradient(circle, #c8973a44 0%, transparent 70%);
    top: 40%;
    left: 60%;
    animation-duration: 30s;
    animation-delay: -15s;
}

@keyframes orbFloat {
    0% {
        transform: translate(0, 0) scale(1);
    }

    50% {
        transform: translate(30px, 40px) scale(1.07);
    }

    100% {
        transform: translate(-20px, 20px) scale(0.95);
    }
}

/* ---------- PAGE WRAPPER ---------- */
.page-wrapper {
    position: relative;
    z-index: 1;
    max-width: 760px;
    margin: 0 auto;
    padding: 40px 20px 60px;
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---------- HEADER ---------- */
.form-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 32px;
    flex-wrap: wrap;
    gap: 12px;
}

.logo-wrap {
    display: flex;
    align-items: center;
    cursor: default;
    user-select: none;
}

.brand-logo {
    height: 44px;
    width: auto;
    max-width: 220px;
    object-fit: contain;
    filter: brightness(0) invert(1) drop-shadow(0 2px 8px rgba(26, 111, 175, 0.4));
    transition: transform 0.3s ease, filter 0.3s ease;
}

.logo-wrap:hover .brand-logo {
    transform: scale(1.04);
    filter: brightness(0) invert(1) drop-shadow(0 4px 16px rgba(26, 111, 175, 0.65));
}

.header-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    background: rgba(26, 111, 175, 0.18);
    border: 1px solid rgba(26, 111, 175, 0.35);
    border-radius: 100px;
    padding: 5px 14px;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--blue-light);
    letter-spacing: 0.04em;
}

.badge-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--success);
    box-shadow: 0 0 8px var(--success);
    animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.4);
        opacity: 0.6;
    }
}

/* ---------- FORM CARD ---------- */
.form-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-xl);
    padding: 44px 48px;
    box-shadow: var(--shadow-card), var(--shadow-glow);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    position: relative;
    overflow: hidden;
}

.form-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--blue-mid), var(--gold), var(--blue-light));
    border-radius: var(--radius-xl) var(--radius-xl) 0 0;
}

/* Card intro */
.card-intro {
    margin-bottom: 36px;
}

.card-title {
    font-size: 1.75rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: 8px;
    letter-spacing: -0.01em;
}

.card-desc {
    color: var(--text-secondary);
    font-size: 0.88rem;
}

.req-mark {
    color: var(--gold-light);
    font-weight: 700;
}

/* ---------- FORM SECTIONS ---------- */
.form-section {
    margin-bottom: 32px;
    transition: opacity 0.35s ease, transform 0.35s ease;
}

.form-section.slide-in {
    animation: slideIn 0.4s ease forwards;
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(16px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section-label {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
    font-size: 0.8rem;
    font-weight: 600;
    color: var(--text-secondary);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

.section-num {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--blue-mid), var(--blue-dark));
    border: 1px solid rgba(63, 163, 245, 0.3);
    font-size: 0.7rem;
    font-weight: 700;
    color: var(--blue-light);
}

.section-label::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(90deg, var(--border), transparent);
}

/* ---------- TOGGLE GROUP (Sí/No) ---------- */
.toggle-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

/* Panel de elección de datos de contacto */
.contact-choice {
    margin: 16px 0 8px;
    padding: 16px 20px;
    background: rgba(26, 111, 175, 0.08);
    border: 1px solid rgba(26, 111, 175, 0.25);
    border-radius: var(--radius-sm);
}

.contact-choice-label {
    font-size: 0.87rem;
    color: var(--text-secondary);
    margin: 0 0 12px;
    line-height: 1.5;
}

.contact-choice .toggle-btn {
    font-size: 0.82rem;
    padding: 9px 16px;
    min-width: 120px;
}

.toggle-btn {
    flex: 1;
    min-width: 150px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 13px 22px;
    border-radius: var(--radius-md);
    border: 1.5px solid var(--border);
    background: var(--surface-2);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.9rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
}

.toggle-btn:hover {
    border-color: var(--blue-mid);
    color: var(--text-primary);
    background: rgba(26, 111, 175, 0.12);
}

.toggle-btn.active {
    border-color: var(--blue-mid);
    background: rgba(26, 111, 175, 0.2);
    color: var(--blue-light);
    box-shadow: 0 0 18px rgba(26, 111, 175, 0.25), inset 0 0 12px rgba(26, 111, 175, 0.1);
}

.toggle-btn.active .toggle-icon {
    color: var(--success);
}

.toggle-btn:not(.active) .toggle-icon {
    opacity: 0.5;
}

/* ---------- FIELD GROUP ---------- */
.field-group {
    margin-bottom: 20px;
}

.field-group:last-child {
    margin-bottom: 0;
}

.fields-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.full-width {
    grid-column: 1 / -1;
}

.field-label {
    display: block;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-secondary);
    margin-bottom: 8px;
    letter-spacing: 0.02em;
}

.field-label.required::after {
    content: ' *';
    color: var(--gold-light);
}

/* ---------- INPUTS ---------- */
.input-wrap {
    position: relative;
}

.input-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-muted);
    display: flex;
    align-items: center;
    pointer-events: none;
    transition: color 0.2s;
}

.form-input {
    width: 100%;
    padding: 12px 16px;
    background: rgba(255, 255, 255, 0.04);
    border: 1.5px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-primary);
    font-family: inherit;
    font-size: 0.9rem;
    outline: none;
    transition: border-color 0.25s ease, background 0.25s ease, box-shadow 0.25s ease;
    -webkit-appearance: none;
    appearance: none;
}

/* Inputs inside .input-wrap always have an icon — add left padding for it */
.input-wrap .form-input {
    padding-left: 42px;
}

.form-input:focus {
    border-color: var(--blue-light);
    background: rgba(63, 163, 245, 0.07);
    box-shadow: 0 0 0 3px rgba(63, 163, 245, 0.15);
}

.input-wrap .form-input:focus+.input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--blue-light);
}

.form-input:focus-within+.input-icon,
.input-wrap:focus-within .input-icon {
    color: var(--blue-light);
}

.form-input[readonly] {
    opacity: 0.7;
    cursor: not-allowed;
    background: rgba(255, 255, 255, 0.02);
    border-color: rgba(255, 255, 255, 0.06);
}

.form-input::placeholder {
    color: var(--text-muted);
}

.form-textarea {
    resize: vertical;
    min-height: 100px;
    padding-top: 14px;
    padding-bottom: 14px;
    padding-left: 16px;
    -webkit-appearance: none;
    appearance: none;
}

.field-hint {
    margin-top: 7px;
    font-size: 0.78rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.field-error {
    margin-top: 6px;
    font-size: 0.78rem;
    color: var(--error);
    font-weight: 500;
}

/* ---------- SEARCH ROW ---------- */
.search-row {
    display: flex;
    gap: 10px;
    align-items: stretch;
}

.search-row .input-wrap {
    flex: 1;
}

.btn-buscar {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 0 20px;
    background: linear-gradient(135deg, var(--blue-mid), #0d5a9a);
    border: 1px solid rgba(63, 163, 245, 0.3);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.25s ease;
    letter-spacing: 0.02em;
}

.btn-buscar:hover {
    background: linear-gradient(135deg, #2080c0, #1a6faf);
    box-shadow: 0 4px 20px rgba(26, 111, 175, 0.45);
    transform: translateY(-1px);
}

.btn-buscar:active {
    transform: translateY(0);
}

/* ---------- SEARCH RESULT ---------- */
.search-result {
    margin-top: 14px;
    padding: 14px 18px;
    border-radius: var(--radius-md);
    font-size: 0.85rem;
    border: 1px solid;
    animation: slideIn 0.3s ease;
}

.search-result.success {
    background: rgba(34, 197, 94, 0.1);
    border-color: rgba(34, 197, 94, 0.3);
    color: #a6efb8;
}

.search-result.error {
    background: rgba(239, 68, 68, 0.1);
    border-color: rgba(239, 68, 68, 0.3);
    color: #fca5a5;
}

.search-result.info {
    background: rgba(26, 111, 175, 0.1);
    border-color: rgba(26, 111, 175, 0.3);
    color: var(--blue-light);
}

/* ---------- SUBMIT BUTTON ---------- */
.form-submit {
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.btn-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    width: 100%;
    padding: 16px 32px;
    background: linear-gradient(135deg, #1a6faf 0%, #c8973a 100%);
    border: none;
    border-radius: var(--radius-md);
    color: #fff;
    font-family: inherit;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: all 0.3s ease;
    box-shadow: 0 6px 28px rgba(26, 111, 175, 0.4);
    position: relative;
    overflow: hidden;
}

.btn-submit::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.12), transparent);
    opacity: 0;
    transition: opacity 0.3s;
}

.btn-submit:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(26, 111, 175, 0.55), 0 4px 12px rgba(200, 151, 58, 0.3);
}

.btn-submit:hover::before {
    opacity: 1;
}

.btn-submit:active {
    transform: translateY(0);
}

.btn-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-arrow {
    transition: transform 0.25s ease;
}

.btn-submit:hover .btn-arrow {
    transform: translateX(4px);
}

.submit-hint {
    font-size: 0.76rem;
    color: var(--text-muted);
    text-align: center;
}

/* ---------- SPINNER ---------- */
.btn-spinner {
    width: 18px;
    height: 18px;
    border: 2.5px solid rgba(255, 255, 255, 0.3);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.75s linear infinite;
    display: inline-block;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* ---------- HIDDEN UTILITY ---------- */
.hidden {
    display: none !important;
}

/* ---------- TOAST ---------- */
.toast {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 22px;
    border-radius: var(--radius-md);
    backdrop-filter: blur(20px);
    font-size: 0.88rem;
    font-weight: 500;
    max-width: 360px;
    animation: toastIn 0.4s cubic-bezier(.34, 1.56, .64, 1) forwards;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.5);
}

.toast.toast-success {
    background: rgba(34, 197, 94, 0.2);
    border: 1px solid rgba(34, 197, 94, 0.4);
    color: #a6efb8;
}

.toast.toast-error {
    background: rgba(239, 68, 68, 0.2);
    border: 1px solid rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.toast.toast-info {
    background: rgba(26, 111, 175, 0.25);
    border: 1px solid rgba(63, 163, 245, 0.4);
    color: var(--blue-light);
}

.toast-icon {
    font-size: 1.1rem;
}

@keyframes toastIn {
    from {
        opacity: 0;
        transform: translateX(30px) scale(0.95);
    }

    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}

/* ---------- FOOTER ---------- */
.page-footer {
    margin-top: 28px;
    text-align: center;
    font-size: 0.76rem;
    color: var(--text-muted);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.footer-sep {
    opacity: 0.4;
}

/* ---------- MODALS ---------- */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 9990;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(8px);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn 0.2s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

.modal-card {
    background: #0e2840;
    border: 1px solid rgba(63, 163, 245, 0.2);
    border-radius: var(--radius-xl);
    width: 100%;
    max-width: 600px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 32px 80px rgba(0, 0, 0, 0.7);
    animation: modalIn 0.35s cubic-bezier(.34, 1.4, .64, 1) forwards;
    overflow: hidden;
}

.modal-card-sm {
    max-width: 380px;
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(0.92) translateY(20px);
    }

    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 22px 28px 18px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
}

.modal-title-row {
    display: flex;
    align-items: center;
    gap: 10px;
}

.modal-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--text-primary);
    letter-spacing: -0.01em;
}

.modal-close {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    color: var(--text-secondary);
    font-size: 1.1rem;
    cursor: pointer;
    transition: all 0.2s;
}

.modal-close:hover {
    background: rgba(239, 68, 68, 0.2);
    border-color: rgba(239, 68, 68, 0.4);
    color: #fca5a5;
}

.modal-body {
    padding: 24px 28px;
    overflow-y: auto;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 24px;
}



.config-section-title {
    font-size: 0.82rem;
    font-weight: 700;
    color: var(--blue-light);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 14px;
    padding-bottom: 8px;
    border-bottom: 1px solid var(--border);
}

.config-hint {
    font-size: 0.78rem;
    color: var(--text-muted);
    margin-bottom: 12px;
    line-height: 1.5;
}

.config-hint a {
    color: var(--blue-light);
    text-decoration: none;
}

.config-hint a:hover {
    text-decoration: underline;
}

.modal-footer {
    display: flex;
    gap: 10px;
    justify-content: flex-end;
    padding: 18px 28px;
    border-top: 1px solid var(--border);
    flex-shrink: 0;
}

.btn-save {
    padding: 10px 22px;
    background: linear-gradient(135deg, var(--blue-mid), #0d5a9a);
    border: 1px solid rgba(63, 163, 245, 0.3);
    border-radius: var(--radius-sm);
    color: #fff;
    font-family: inherit;
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-save:hover {
    box-shadow: 0 4px 18px rgba(26, 111, 175, 0.4);
    transform: translateY(-1px);
}

.btn-cancel {
    padding: 10px 20px;
    background: transparent;
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text-secondary);
    font-family: inherit;
    font-size: 0.88rem;
    cursor: pointer;
    transition: all 0.2s;
}

.btn-cancel:hover {
    background: var(--surface-2);
    color: var(--text-primary);
}

.btn-logs {
    padding: 10px 18px;
    background: rgba(26, 111, 175, 0.12);
    border: 1px solid rgba(26, 111, 175, 0.35);
    border-radius: var(--radius-sm);
    color: var(--blue-light);
    font-family: inherit;
    font-size: 0.85rem;
    cursor: pointer;
    transition: all 0.2s;
    margin-left: auto;
}

.btn-logs:hover {
    background: rgba(26, 111, 175, 0.25);
    border-color: var(--blue-light);
}

/* Modal inputs no icon */
.modal-body .form-input {
    padding-left: 16px;
}

/* ---------- INPUT VALIDATION STATES ---------- */
.form-input.is-invalid {
    border-color: var(--error) !important;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.15) !important;
}

.form-input.is-valid {
    border-color: var(--success) !important;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 640px) {
    .form-card {
        padding: 28px 20px;
        border-radius: var(--radius-lg);
    }

    .fields-grid {
        grid-template-columns: 1fr;
    }

    .card-title {
        font-size: 1.4rem;
    }

    .toggle-group {
        flex-direction: column;
    }

    .toggle-btn {
        min-width: unset;
    }

    .search-row {
        flex-direction: column;
    }

    .btn-buscar {
        padding: 13px 20px;
    }

    .modal-card {
        max-height: 95vh;
    }

    .modal-header,
    .modal-body,
    .modal-footer {
        padding-left: 18px;
        padding-right: 18px;
    }
}

@media (max-width: 380px) {
    .form-header {
        flex-direction: column;
        align-items: flex-start;
    }
}