/* ── Base cromatica dos controles de formulario ───────────────────────
   color-scheme: light impede o modo escuro automatico do navegador de
   pintar inputs/selects de cinza-escuro. Seletores de elemento tem a
   menor especificidade, entao qualquer regra de classe existente vence. */
:root { color-scheme: light; }

input, select, textarea {
    background-color: #ffffff;
    color: #083f65;
}

input::placeholder,
textarea::placeholder { color: #8fa6b3; }

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Inter', sans-serif;
    background: #0a1a2f;
    min-height: 100vh;
    position: relative;
}

/* Fundo institucional */
.hero-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
    overflow: hidden;
}

.hero-background::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(8, 28, 51, 0.92) 0%, rgba(2, 18, 35, 0.96) 100%);
    z-index: 1;
}

.bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    filter: brightness(0.6) contrast(1.1);
}

/* Container principal */
.main-container {
    position: relative;
    z-index: 2;
    width: 100%;
    max-width: 1400px;
    margin: 2rem auto;
    background: rgba(255, 255, 255, 0.98);
    border-radius: 32px;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.4);
    overflow: hidden;
    padding: 2rem 3rem;
}

/* Progress Steps */
.progress-steps {
    display: flex;
    justify-content: space-between;
    margin-bottom: 3rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #e2e8f0;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.step {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem;
    background: #f8fafc;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    opacity: 0.6;
}

.step.active {
    opacity: 1;
    background: #0a4b7a;
    color: white;
}

.step.active .step-number {
    background: white;
    color: #0a4b7a;
}

.step.completed {
    opacity: 1;
    background: #e6f7e6;
    color: #2c6e2c;
}

.step.completed .step-number {
    background: #2c6e2c;
    color: white;
}

.step-number {
    width: 32px;
    height: 32px;
    background: #cbd5e1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 0.9rem;
}

.step-label {
    font-weight: 600;
    font-size: 0.85rem;
}

/* Form Steps */
.form-step {
    display: none;
    animation: fadeIn 0.4s ease;
}

.form-step.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Form Section Header */
.form-section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 3px solid #0a4b7a;
}

.form-section-header i {
    font-size: 2rem;
    color: #0a4b7a;
    margin-right: 1rem;
}

.form-section-header h3 {
    display: inline-block;
    font-size: 1.5rem;
    font-weight: 700;
    color: #0a2b44;
    margin-bottom: 0.5rem;
}

.form-section-header p {
    color: #5b6e8c;
    margin-top: 0.5rem;
    margin-left: 2.8rem;
}

/* Input Fields */
.input-group-custom {
    margin-bottom: 1.5rem;
}

.input-group-custom label {
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #2c3e66;
    margin-bottom: 0.5rem;
    display: block;
}

.input-group-custom label .required {
    color: #dc3545;
    margin-left: 0.25rem;
}

.input-field {
    width: 100%;
    padding: 0.85rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    font-size: 0.95rem;
    transition: all 0.2s;
    background: #ffffff;
    font-weight: 500;
}

.input-field:focus {
    outline: none;
    border-color: #0a4b7a;
    box-shadow: 0 0 0 3px rgba(10, 75, 122, 0.15);
}

textarea.input-field {
    resize: vertical;
    min-height: 80px;
}

small {
    font-size: 0.7rem;
    color: #7c8ba0;
    margin-top: 0.25rem;
    display: block;
}

/* Select2 Customization */
.select2-container--bootstrap-5 .select2-selection {
    padding: 0.65rem 1rem;
    border: 1.5px solid #e2e8f0;
    border-radius: 12px;
    min-height: 52px;
}

.select2-container--bootstrap-5 .select2-selection--multiple .select2-selection__rendered {
    gap: 0.5rem;
}

/* Skills Container */
.selected-competences {
    margin-top: 2rem;
}

.selected-competences label {
    font-weight: 700;
    color: #2c3e66;
    margin-bottom: 1rem;
    display: block;
}

.skills-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    min-height: 80px;
    padding: 1rem;
    background: #f8fafc;
    border-radius: 16px;
    border: 1px dashed #cbd5e1;
}

.skill-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    background: #0a4b7a;
    color: white;
    border-radius: 30px;
    font-size: 0.85rem;
    font-weight: 500;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

.skill-tag i {
    cursor: pointer;
    font-size: 0.8rem;
    transition: transform 0.2s;
}

.skill-tag i:hover {
    transform: scale(1.2);
    color: #ff6b6b;
}

.btn-add-skill {
    padding: 0.85rem 1.5rem;
    background: #0a4b7a;
    color: white;
    border: none;
    border-radius: 12px;
    font-weight: 600;
    transition: all 0.2s;
}

.btn-add-skill:hover {
    background: #063a5e;
    transform: translateY(-1px);
}

/* Experience & Education Cards */
.experience-card, .education-card {
    background: #f9fbfd;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 1.5rem;
    margin-bottom: 1.5rem;
    transition: all 0.2s;
}

.experience-header, .education-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e2e8f0;
}

.experience-header h5, .education-header h5 {
    margin: 0;
    color: #0a4b7a;
    font-weight: 700;
}

.remove-experience-btn, .remove-education-btn {
    background: none;
    border: none;
    color: #dc3545;
    cursor: pointer;
    padding: 0.5rem;
    border-radius: 8px;
    transition: all 0.2s;
}

.remove-experience-btn:hover, .remove-education-btn:hover {
    background: #fff0f0;
}

.btn-add-experience, .btn-add-education {
    width: 100%;
    padding: 1rem;
    background: transparent;
    border: 2px dashed #cbd5e1;
    border-radius: 16px;
    font-weight: 600;
    color: #0a4b7a;
    transition: all 0.2s;
    margin-top: 1rem;
}

.btn-add-experience:hover, .btn-add-education:hover {
    background: #f0f6fe;
    border-color: #0a4b7a;
}

/* Upload Areas */
.upload-area {
    border: 2px dashed #cbd5e1;
    border-radius: 20px;
    padding: 2rem;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s;
    background: #f9fbfd;
    position: relative;
    min-height: 220px;
}

.upload-area:hover {
    border-color: #0a4b7a;
    background: #f0f6fe;
}

.upload-icon i {
    font-size: 3rem;
    color: #0a4b7a;
    margin-bottom: 1rem;
}

.upload-text h6 {
    font-weight: 700;
    color: #2c3e66;
    margin-bottom: 0.5rem;
}

.upload-text p {
    font-size: 0.85rem;
    color: #7c8ba0;
    margin: 0;
}

.photo-preview, .file-preview {
    margin-top: 1rem;
    max-width: 100%;
}

.photo-preview img {
    max-width: 150px;
    border-radius: 12px;
    border: 2px solid #0a4b7a;
}

/* Declaration Area */
.declaration-area {
    margin-top: 2rem;
    padding: 1.5rem;
    background: #f8fafc;
    border-radius: 16px;
    border-left: 4px solid #0a4b7a;
}

.checkbox-custom {
    display: flex;
    align-items: flex-start;
    gap: 1rem;
    cursor: pointer;
}

.checkbox-custom input {
    position: absolute;
    opacity: 0;
    cursor: pointer;
    height: 0;
    width: 0;
}

.checkmark {
    position: relative;
    display: inline-block;
    width: 22px;
    height: 22px;
    background: white;
    border: 2px solid #cbd5e1;
    border-radius: 6px;
    flex-shrink: 0;
    transition: all 0.2s;
}

.checkbox-custom:hover input ~ .checkmark {
    border-color: #0a4b7a;
}

.checkbox-custom input:checked ~ .checkmark {
    background: #0a4b7a;
    border-color: #0a4b7a;
}

.checkmark:after {
    content: "";
    position: absolute;
    display: none;
}

.checkbox-custom input:checked ~ .checkmark:after {
    display: block;
    left: 7px;
    top: 3px;
    width: 5px;
    height: 10px;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

.declaration-text {
    font-size: 0.8rem;
    color: #2c3e66;
    line-height: 1.4;
}

/* Form Navigation */
.form-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 2px solid #e2e8f0;
}

.btn-prev, .btn-next, .btn-submit {
    padding: 0.9rem 2rem;
    border: none;
    border-radius: 14px;
    font-weight: 700;
    font-size: 0.95rem;
    transition: all 0.2s;
    cursor: pointer;
}

.btn-prev {
    background: #f1f5f9;
    color: #2c3e66;
}

.btn-prev:hover:not(:disabled) {
    background: #e2e8f0;
    transform: translateX(-2px);
}

.btn-prev:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.btn-next {
    background: #0a4b7a;
    color: white;
}

.btn-next:hover {
    background: #063a5e;
    transform: translateX(2px);
}

.btn-submit {
    background: #2c6e2c;
    color: white;
}

.btn-submit:hover {
    background: #1e551e;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(44, 110, 44, 0.3);
}

/* Info Note */
.info-note {
    margin-top: 1.5rem;
    padding: 1rem;
    background: #e8f0fe;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.info-note i {
    color: #0a4b7a;
    font-size: 1.2rem;
}

.info-note span {
    font-size: 0.8rem;
    color: #2c3e66;
}

/* Responsive */
@media (max-width: 992px) {
    .main-container {
        margin: 1rem;
        padding: 1.5rem;
    }

    .progress-steps {
        gap: 0.5rem;
    }

    .step-label {
        display: none;
    }

    .step {
        padding: 0.5rem;
    }
}

@media (max-width: 768px) {
    .form-navigation {
        flex-direction: column;
        gap: 1rem;
    }

    .btn-prev, .btn-next, .btn-submit {
        width: 100%;
    }

    .form-section-header h3 {
        font-size: 1.2rem;
    }

    .form-section-header i {
        font-size: 1.5rem;
    }
}

.loading-overlay {
    position: fixed;
    inset: 0;
    background: rgba(5, 25, 45, 0.75);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 99999;
}

.loading-box {
    background: #ffffff;
    padding: 2rem 2.5rem;
    border-radius: 18px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    box-shadow: 0 20px 40px rgba(0,0,0,0.35);
    border-top: 5px solid #0a4b7a;
    font-weight: 600;
    color: #0a2b44;
    min-width: 200px;
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #dbe6f0;
    border-top: 5px solid #0a4b7a;
    border-radius: 50%;
    animation: spin 0.9s linear infinite;
}

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

body.loading-active {
    overflow: hidden;
}