/* Styles for Instituição Estrangeira form (do not override global drupal styles) */
.stepper-steps {
    gap: 0.75rem;
}

.stepper-steps .step {
    padding: 14px 12px;
    border-radius: 4px;
    background: #f1f5f9;
    color: #333;
    margin-right: 6px;
    font-size: 12px;
    font-weight: 600;
    position: relative;
    cursor: pointer;
    transition: transform .12s ease, box-shadow .12s ease;
}

.stepper-steps .step:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 69, 124, 0.12);
}

.stepper-steps .step:hover {
    transform: translateY(-2px);
}

.stepper-steps .step.active {
    background: #00457c;
    color: #fff;
}

.stepper-steps .step.completed {
    background: #5575b9;
    color: #fff;
}

.stepper-steps .step.completed::after {
    font-weight: 700;
    margin-left: 8px;
}

.stepper-steps .step.step-has-error {
    box-shadow: inset 0 -4px 0 0 rgba(220, 53, 69, 0.12);
}

.stepper-steps .step .step-error-badge {
    margin-left: .5rem;
    font-size: .7rem;
    vertical-align: middle;
}

.step-section {
    display: none;
}

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

.curso-item {
    border: 1px solid #e6e6e6;
}

.custom-file-label {
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

/* show invalid state for custom-file */
.custom-file-input.is-invalid~.custom-file-label {
    border-color: #dc3545;
}

.custom-file-label.is-invalid {
    border-color: #dc3545;
}

/* progress bar styling */
.progress {
    background-color: #e9eef6;
}

.progress .progress-bar {
    background-color: #00457c;
    transition: width .35s ease;
}

/* Headings and spacing */
.step-section h3 {
    font-size: 18px;
    margin-bottom: 1.5rem;
    color: #00457c;
}

.form-subtitle {
    font-size: 15px;
    margin-top: 2rem;
    margin-bottom: 1rem;
    color: #00457c;
    font-weight: 600;
}

.step-section label {
    font-weight: 600;
}

.step-section .small {
    color: #6b7280;
}

.drupal-link-button {
    background-color: #a50d4b;
    border-color: #a50d4b;
    color: #fff !important;
}

.drupal-back-button {
    background-color: #5575b9;
    border-color: #5575b9;
    color: #fff !important;
}

/* Small utilities */
.invalid-feedback {
    display: block;
}

@media (max-width: 767px) {
    .stepper-steps {
        overflow-x: auto;
    }
}

/* Cursos card improvements */
.curso-card-header {
    background: #f8fafc;
    padding: 0.75rem 1rem;
    border-bottom: 1px solid #e6e6e6;
}

.curso-card-header .btn-link {
    color: #00457c;
    font-weight: 600;
    text-decoration: none;
}

.curso-card-header .curso-name-preview {
    font-size: 0.9rem;
    color: #6b7280;
}

.curso-index-badge {
    background-color: #5575b9;
    color: #fff;
    font-weight: 600;
}

.curso-item .card-body {
    padding-top: 1rem;
}

/* Highlight course card when it contains validation errors */
.curso-item.curso-has-error .curso-card-header {
    border-left: 4px solid #dc3545;
}

.curso-item.curso-has-error .curso-index-badge {
    background-color: #dc3545;
}

/* Radios & Checkboxes */
#pedido-ies-form .form-check-inline {
    margin-right: 1rem;
}

#pedido-ies-form .form-check-label {
    margin-left: 0.5rem;
    cursor: pointer;
    display: inline-block;
    padding: 6px 8px;
    border-radius: 6px;
    transition: background .12s ease, color .12s ease, transform .08s ease;
    font-weight: 600;
    color: #6b7280;
}

#pedido-ies-form .form-check-input {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
    width: 18px;
    height: 18px;
    display: inline-block;
    vertical-align: middle;
    border: 2px solid #5575b9;
    background-color: #fff;
    transition: background-color .12s ease, border-color .12s ease, box-shadow .12s ease;
    flex: 0 0 auto;
    cursor: pointer;
}

#pedido-ies-form .form-check-input[type="radio"] {
    border-radius: 50%;
}

#pedido-ies-form .form-check-input[type="checkbox"] {
    border-radius: 4px;
}

#pedido-ies-form .form-check-input:checked {
    background-color: #00457c;
    border-color: #00457c;
}

#pedido-ies-form .form-check-input[type="radio"]:checked {
    background-image: radial-gradient(circle, #fff 40%, transparent 41%);
    background-size: 100% 100%;
    background-position: center;
    background-repeat: no-repeat;
}

#pedido-ies-form .form-check-input[type="checkbox"]:checked {
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='https://www.w3.org/2000/svg' viewBox='0 0 16 16'><polyline points='3 9 7 13 13 4' fill='none' stroke='%23ffffff' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/></svg>");
    background-position: center;
    background-repeat: no-repeat;
    background-size: 12px 12px;
}

#pedido-ies-form .form-check-input:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 69, 124, 0.12);
    border-color: #00457c;
}

#pedido-ies-form .form-check-input:checked+.form-check-label {
    background: rgba(0, 69, 124, 0.06);
    color: #00457c;
}

#pedido-ies-form .form-check-input.is-invalid {
    border-color: #dc3545;
    box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.06);
}

#pedido-ies-form .form-check-input.is-invalid+.form-check-label {
    color: #dc3545;
}

#pedido-ies-form .form-check-label {
    line-height: 1.1;
}

/* Confirmation page */
.confirmation-hero {
    border-left: 6px solid #00457c;
    padding: 1rem 1.25rem;
    border-radius: 4px;
}

.confirmation-hero .material-icons {
    color: #00457c;
    font-size: 44px;
}

.confirmation-hero h1 {
    color: #00457c;
}

.badge-reference {
    display: inline-block;
    background-color: #00457c;
    color: #fff;
    font-weight: 700;
    padding: .25rem .5rem;
    border-radius: 6px;
}