/* ============================================
   CANDIDATURA STEPPER FORM STYLES
   ============================================ */

/* --- Progress Bar / Stepper --- */
.stepper-wrapper {
    display: flex;
    justify-content: space-between;
    margin-bottom: 40px;
    position: relative;
}

.stepper-wrapper::before {
    content: '';
    position: absolute;
    top: 20px;
    left: 0;
    width: 100%;
    height: 3px;
    background: #e0e0e0;
    z-index: 0;
}

.stepper-progress-line {
    position: absolute;
    top: 20px;
    left: 0;
    height: 3px;
    background: #5cc7c2;
    z-index: 1;
    transition: width 0.4s ease;
}

.step-indicator {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
    z-index: 2;
    flex: 1;
    cursor: default;
}

.step-circle {
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background: #fff;
    border: 3px solid #e0e0e0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    font-size: 15px;
    color: #aaa;
    transition: all 0.3s ease;
    margin-bottom: 8px;
}

.step-indicator.active .step-circle,
.step-indicator.completed .step-circle {
    border-color: #5cc7c2;
    background: #5cc7c2;
    color: #fff;
    box-shadow: 0 4px 15px rgba(92, 199, 194, 0.35);
}

.step-indicator.completed .step-circle::after {
    content: '\f00c';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    font-size: 14px;
}

.step-indicator.completed .step-number {
    display: none;
}

.step-label {
    font-size: 12px;
    font-weight: 600;
    color: #aaa;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    max-width: 100px;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.step-indicator.active .step-label,
.step-indicator.completed .step-label {
    color: #5cc7c2;
}

/* --- Step Content Panels --- */
.step-content {
    display: none;
    animation: fadeInStep 0.4s ease;
}

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

@keyframes fadeInStep {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

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

.step-panel {
    background: #fff;
    border-radius: 12px;
    padding: 35px 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.06);
    border: 1px solid #f0f0f0;
}

.step-panel h4 {
    margin-bottom: 8px;
    font-weight: 700;
    color: #232323;
}

.step-panel .step-subtitle {
    color: #888;
    font-size: 14px;
    margin-bottom: 25px;
}

/* --- Form Fields --- */
.candidatura-form .form-group {
    margin-bottom: 20px;
}

.candidatura-form label {
    font-weight: 600;
    font-size: 14px;
    color: #333;
    margin-bottom: 6px;
    display: block;
}

.candidatura-form label .required {
    color: #e74c3c;
    margin-left: 2px;
}

.candidatura-form .form-control {
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    background: #fafafa;
}

.candidatura-form .form-control:focus {
    border-color: #5cc7c2;
    box-shadow: 0 0 0 3px rgba(92, 199, 194, 0.18);
    background: #fff;
}

.candidatura-form .form-control.is-invalid {
    border-color: #e74c3c;
    box-shadow: 0 0 0 3px rgba(231, 76, 60, 0.1);
}

.candidatura-form .invalid-feedback {
    color: #e74c3c;
    font-size: 12px;
    margin-top: 4px;
}

.candidatura-form select.form-control {
    appearance: none;
    -webkit-appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23888' d='M6 8L1 3h10z'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 36px;
}

/* --- Checkbox / Radio Styling --- */
.candidatura-form .form-check {
    margin-bottom: 10px;
    padding-left: 28px;
}

.candidatura-form .form-check-input {
    width: 18px;
    height: 18px;
    margin-top: 3px;
    margin-left: -28px;
    cursor: pointer;
    accent-color: #5cc7c2;
}

.candidatura-form .form-check-label {
    font-weight: 400;
    font-size: 14px;
    color: #555;
    cursor: pointer;
    line-height: 1.6;
}

/* --- Character Counter --- */
.char-counter {
    text-align: right;
    font-size: 12px;
    color: #999;
    margin-top: 4px;
    transition: color 0.3s ease;
}

.char-counter.warning {
    color: #e67e22;
}

.char-counter.danger {
    color: #e74c3c;
    font-weight: 600;
}

/* --- Dynamic Table (Cronograma / Orçamento) --- */
.dynamic-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 15px;
}

.dynamic-table thead th {
    background: #5cc7c2;
    color: #fff;
    font-weight: 600;
    font-size: 13px;
    padding: 12px 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: none;
}

.dynamic-table tbody td {
    padding: 10px 14px;
    border-top: 1px solid #f0f0f0;
    vertical-align: middle;
}

.dynamic-table tbody tr:hover {
    background: #edfafa;
}

.dynamic-table .form-control {
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.dynamic-table .btn-remove-row {
    background: none;
    border: none;
    color: #e74c3c;
    font-size: 18px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: background 0.2s ease;
}

.dynamic-table .btn-remove-row:hover {
    background: rgba(231, 76, 60, 0.1);
}

.btn-remove-objetivo {
    background: none;
    border: none;
    color: #bbb;
    font-size: 13px;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    transition: color 0.2s ease;
    flex-shrink: 0;
}

.btn-remove-objetivo:hover {
    color: #e74c3c;
}

.btn-add-row {
    background: transparent;
    border: 2px dashed #5cc7c2;
    color: #5cc7c2;
    font-weight: 600;
    font-size: 13px;
    padding: 8px 20px;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.btn-add-row:hover {
    background: rgba(137, 60, 177, 0.08);
}

.btn-add-row i {
    margin-right: 6px;
}

/* --- Orçamento Total --- */
.orcamento-total {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 15px 20px;
    background: #edfafa;
    border-radius: 8px;
    margin-top: 10px;
}

.orcamento-total span {
    font-weight: 700;
    font-size: 16px;
    color: #5cc7c2;
    margin-left: 10px;
}

.orcamento-total label {
    font-weight: 700;
    font-size: 14px;
    color: #333;
    margin-bottom: 0;
}

/* --- File Upload --- */
.file-upload-area {
    border: 2px dashed #d0d0d0;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fafafa;
    position: relative;
}

.file-upload-area:hover {
    border-color: #5cc7c2;
    background: #edfafa;
}

.file-upload-area i {
    font-size: 36px;
    color: #5cc7c2;
    margin-bottom: 10px;
    display: block;
}

.file-upload-area p {
    margin: 0;
    font-size: 14px;
    color: #666;
}

.file-upload-area small {
    color: #999;
    font-size: 12px;
}

.file-upload-area input[type="file"] {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.file-list {
    margin-top: 15px;
}

.file-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    background: #f9f9f9;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid #eee;
}

.file-item .file-name {
    font-size: 13px;
    color: #333;
    font-weight: 500;
}

.file-item .file-size {
    font-size: 12px;
    color: #999;
    margin-left: 10px;
}

.file-item .btn-remove-file {
    background: none;
    border: none;
    color: #e74c3c;
    cursor: pointer;
    font-size: 16px;
    padding: 2px 6px;
}

/* --- Declaration Checkboxes --- */
.declaration-box {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 25px;
    border: 1px solid #eee;
    margin-bottom: 15px;
}

.declaration-box .form-check-label {
    font-size: 13px;
    line-height: 1.7;
    color: #444;
}

/* --- Navigation Buttons --- */
.step-navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 30px;
    padding-top: 25px;
    border-top: 1px solid #f0f0f0;
}

.btn-step-prev {
    display: inline-flex;
    align-items: center;
    padding: 12px 28px;
    background: transparent;
    border: 2px solid #ddd;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13px;
    color: #666;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
}

.btn-step-prev:hover {
    border-color: #5cc7c2;
    color: #5cc7c2;
}

.btn-step-prev i {
    margin-right: 8px;
}

.btn-step-next,
.btn-step-submit {
    display: inline-flex;
    align-items: center;
    padding: 12px 32px;
    background: #5cc7c2;
    border: none;
    border-radius: 40px;
    font-weight: 600;
    font-size: 13px;
    color: #fff;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(92, 199, 194, 0.35);
}

.btn-step-next:hover,
.btn-step-submit:hover {
    box-shadow: 0 6px 25px rgba(92, 199, 194, 0.5);
    transform: translateY(-1px);
}

.btn-step-next:disabled,
.btn-step-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.btn-step-next i {
    margin-left: 8px;
}

.btn-step-submit i {
    margin-right: 8px;
}

/* --- Alerts --- */
.candidatura-alert {
    padding: 18px 24px;
    border-radius: 10px;
    font-size: 14px;
    margin-bottom: 20px;
    display: none;
    animation: fadeInStep 0.3s ease;
}

.candidatura-alert.alert-success {
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

.candidatura-alert.alert-danger {
    background: #f8d7da;
    color: #721c24;
    border: 1px solid #f5c6cb;
}

/* --- Section Divider --- */
.section-divider {
    border: none;
    border-top: 1px dashed #e0e0e0;
    margin: 25px 0;
}

/* --- Loading Spinner --- */
.spinner-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    flex-direction: column;
}

.spinner-overlay.active {
    display: flex;
}

.spinner-ring {
    width: 50px;
    height: 50px;
    border: 4px solid #e0e0e0;
    border-top-color: #5cc7c2;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

.spinner-overlay p {
    margin-top: 15px;
    font-weight: 600;
    color: #5cc7c2;
    font-size: 14px;
}

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

/* ============================================
   RESPONSIVE
   ============================================ */
@media (max-width: 768px) {
    .stepper-wrapper {
        flex-wrap: nowrap;
        overflow-x: auto;
        padding-bottom: 10px;
        gap: 0;
    }

    .step-indicator {
        min-width: 60px;
    }

    .step-label {
        font-size: 10px;
        max-width: 60px;
    }

    .step-circle {
        width: 34px;
        height: 34px;
        font-size: 13px;
    }

    .step-panel {
        padding: 25px 18px;
    }

    .step-navigation {
        flex-direction: column;
        gap: 12px;
    }

    .btn-step-prev,
    .btn-step-next,
    .btn-step-submit {
        width: 100%;
        justify-content: center;
    }

    .dynamic-table {
        font-size: 13px;
    }

    .dynamic-table thead th {
        padding: 10px 8px;
        font-size: 11px;
    }

    .dynamic-table tbody td {
        padding: 8px 6px;
    }

    .orcamento-total {
        flex-direction: column;
        text-align: center;
        gap: 5px;
    }
}

@media (max-width: 480px) {
    .step-label {
        display: none;
    }

    .step-circle {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }

    .stepper-wrapper::before,
    .stepper-progress-line {
        top: 15px;
    }
}