.form-renderer-surface {
    margin-top: 4px;
}

.form-renderer-surface .formio-form,
.form-renderer-surface .formio-wizard-form {
    color: #172033;
    font-family: Inter, ui-sans-serif, system-ui, sans-serif;
}

.form-renderer-surface .formio-component {
    display: block;
    width: 100%;
    max-width: 100%;
    margin-bottom: 20px;
}

/* Form.io keeps conditional components in the DOM. Hidden fields must not
   leave an empty input or file shell visible in the form. */
.form-renderer-surface .formio-hidden,
.form-renderer-surface .formio-removed {
    display: none !important;
}

.form-renderer-surface .formio-component-panel {
    border: 0;
    margin: 0;
    padding: 0;
}

.form-renderer-surface .card-header {
    background: transparent;
    border: 0;
    color: #172033;
    font-size: 24px;
    font-weight: 700;
    line-height: 1.3;
    padding: 0 0 18px;
}

.form-renderer-surface .formio-component-content {
    color: #68758d;
    font-size: 14px;
    line-height: 1.65;
}

.form-renderer-surface .formio-component-content h2,
.form-renderer-surface .formio-component-content h3,
.form-renderer-surface .formio-component-content p {
    max-width: 760px;
}

.form-renderer-surface .formio-component-content h2,
.form-renderer-surface .formio-component-content h3 {
    color: #172033;
    margin: 0 0 10px;
}

.form-renderer-surface .formio-component-content p:last-child {
    margin-bottom: 0;
}

.form-renderer-surface .control-label {
    color: #172033;
    font-size: 14px;
    font-weight: 700;
    margin-bottom: 7px;
}

.form-renderer-surface .form-control {
    display: block;
    width: 100%;
    max-width: 100%;
    min-height: 48px;
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    color: #172033;
    padding: 12px 14px;
    box-shadow: none;
}

.form-renderer-surface textarea.form-control {
    min-height: 96px;
}

.form-renderer-surface .formio-component-datetime .input-group {
    position: relative;
}

.form-renderer-surface .formio-component-datetime .input-group > .form-control {
    padding-inline-end: 54px;
}

.form-renderer-surface .formio-component-datetime .input-group > [ref='suffix'] {
    position: absolute;
    inset-inline-end: 2px;
    top: 50%;
    transform: translateY(-50%);
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    border-inline-start: 1px solid #eef1f5;
    border-radius: 0 10px 10px 0;
    background: transparent;
    color: #2563eb;
    cursor: pointer;
}

.form-renderer-surface .formio-component-datetime .input-group > [ref='suffix']:hover {
    background: #eff6ff;
}

.form-renderer-surface .formio-component-datetime .input-group > input:disabled ~ [ref='suffix'] {
    pointer-events: none;
    color: #68758d;
}

.form-renderer-surface input[type='text'],
.form-renderer-surface input[type='email'],
.form-renderer-surface input[type='tel'],
.form-renderer-surface input[type='date'],
.form-renderer-surface input[type='number'],
.form-renderer-surface input[type='url'],
.form-renderer-surface select,
.form-renderer-surface textarea {
    width: 100%;
    max-width: 100%;
}

.form-renderer-surface .choices {
    width: 100%;
    margin-bottom: 0;
}

.form-renderer-surface .choices__inner {
    min-height: 48px;
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    background: #fff;
    color: #172033;
    padding: 8px 14px;
}

.form-renderer-surface .choices[data-type='select-one'] > .form-control {
    display: flex;
    align-items: center;
}

.form-renderer-surface .choices__list--single {
    display: block;
    min-width: 0;
    padding: 0 28px 0 0;
}

.form-renderer-surface .choices.is-focused .choices__inner,
.form-renderer-surface .choices.is-open .choices__inner {
    border-color: #2862e8;
    box-shadow: 0 0 0 3px #dbeafe;
}

.form-renderer-surface .choices__list--dropdown,
.form-renderer-surface .choices__list[aria-expanded] {
    z-index: 10;
    border: 1px solid #d1d9e6;
    border-radius: 12px;
    box-shadow: 0 12px 30px rgb(23 32 51 / 12%);
}

.form-renderer-surface .radio,
.form-renderer-surface .checkbox {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 8px 0;
}

.form-renderer-surface .radio label,
.form-renderer-surface .checkbox label {
    margin: 0;
    color: #344054;
    font-weight: 400;
    line-height: 1.45;
}

.form-renderer-surface input[type='radio'],
.form-renderer-surface input[type='checkbox'] {
    width: 18px;
    height: 18px;
    flex: 0 0 18px;
    accent-color: #2862e8;
    margin: 2px 0 0;
}

@media (max-width: 600px) {
    .admin-page .form-renderer-surface .formio-component-radio [ref='radioGroup'] {
        display: flex;
        flex-direction: column;
        gap: 12px;
    }

    .admin-page .form-renderer-surface .formio-component-radio [ref='wrapper'] {
        display: flex;
        align-items: flex-start;
        gap: 10px;
        width: 100%;
        min-width: 0;
        margin: 0;
    }

    .admin-page .form-renderer-surface .formio-component-radio .form-check-label {
        min-width: 0;
        white-space: normal;
        overflow-wrap: anywhere;
    }
}

.form-renderer-surface .formio-component-file .fileSelector {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 9px;
    min-height: 116px;
    border: 2px dashed #c3cee0;
    border-radius: 14px;
    background: #f9fbff;
    color: #526078;
    padding: 20px 16px;
    font-size: 0;
    text-align: center;
    transition: border-color .15s, background .15s;
}

.form-renderer-surface .formio-component-file .fileSelector::before {
    content: 'Trageți fișierul aici';
    color: #344054;
    font-size: 14px;
    font-weight: 700;
}

.form-renderer-surface .formio-component-file .fileSelector.fileDragOver {
    border-color: #2563eb;
    background: #eff6ff;
}

.form-renderer-surface .formio-component-file .fileSelector .btn {
    margin: 0;
}

.form-renderer-surface .formio-component-file .fileSelector > i {
    order: -1;
    color: #2563eb;
    font-size: 24px;
}

.form-renderer-surface .formio-component-file .fileSelector > .browse {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #2563eb;
    border-radius: 8px;
    background: #fff;
    color: #2563eb;
    font-size: 13px;
    font-weight: 800;
    padding: 9px 13px;
    text-decoration: none;
}

.form-renderer-surface .formio-component-file .fileSelector > .browse:hover {
    background: #eff6ff;
}

.form-renderer-surface .formio-component-file .fileSelector > .browse > i {
    font-size: 14px;
}

.form-renderer-surface .formio-component-file .fileSelector > .browse {
    font-size: 0;
}

.form-renderer-surface .formio-component-file .fileSelector > .browse::after {
    content: 'Selectează fișierul';
    font-size: 13px;
}

.form-renderer-surface .formio-component-file .fileSelector .visually-hidden {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.form-renderer-surface .formio-component-file .list-group {
    margin: 10px 0 0;
    padding: 0;
    border: 0;
    list-style: none;
}

.form-renderer-surface .formio-component-file .list-group-item {
    display: flex;
    align-items: center;
    min-height: 46px;
    margin: 0 0 6px;
    padding: 9px 12px;
    border: 1px solid #e4e8f2;
    border-radius: 9px;
    background: #f9fafb;
    color: #344054;
    font-size: 12px;
}

.form-renderer-surface .form-control:focus {
    border-color: #2862e8;
    box-shadow: 0 0 0 3px #dbeafe;
}

.form-renderer-surface .form-text,
.form-renderer-surface .help-block {
    color: #68758d;
    font-size: 12px;
}

.form-renderer-surface .has-error .form-control {
    border-color: #ef4444;
}

.form-renderer-surface .formio-component-file.has-error .fileSelector {
    border-color: #b91c1c;
    background: #fef2f2;
}

.form-renderer-surface :is(input[type='checkbox'], input[type='radio']).is-invalid {
    outline: 2px solid #b91c1c;
    outline-offset: 2px;
    accent-color: #b91c1c;
}

.form-renderer-surface :is(.formio-component-checkbox, .formio-component-selectboxes, .formio-component-radio):has(input.is-invalid) {
    border-inline-start: 3px solid #b91c1c;
    padding-inline-start: 12px;
}

.enrollment-validation-summary {
    margin: 0 0 20px;
    padding: 16px;
    border: 1px solid #ef4444;
    border-radius: 12px;
    background: #fef2f2;
    color: #b91c1c;
    font-size: 14px;
    line-height: 1.5;
    max-height: 40dvh;
    overflow: auto;
    overflow-wrap: anywhere;
    scroll-margin-block: 110px;
}

.enrollment-validation-summary[hidden] { display: none; }
.enrollment-validation-summary:focus { outline: 3px solid #b91c1c; outline-offset: 3px; }
.enrollment-validation-summary ul { margin: 8px 0 0; padding-inline-start: 20px; }
.enrollment-validation-summary button {
    border: 0;
    background: transparent;
    color: inherit;
    font: inherit;
    text-align: start;
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: pointer;
    padding: 8px 0;
}

.form-renderer-surface .has-error .help-block,
.form-renderer-surface .formio-errors {
    color: #b91c1c;
}

.form-renderer-surface .btn {
    min-height: 46px;
    border-radius: 10px;
    font-weight: 700;
    padding: 10px 18px;
}

.form-renderer-surface .btn-primary {
    background: #2862e8;
    border-color: #2862e8;
}

.form-renderer-surface .btn-secondary {
    background: #fff;
    border-color: #2862e8;
    color: #2862e8;
}

.form-renderer-surface .btn:focus-visible,
.form-renderer-surface .choices:focus-visible,
.form-renderer-surface .form-control:focus-visible {
    outline: 3px solid #dbeafe;
    outline-offset: 1px;
}

/* A saját léptetője helyettesíti a Form.io alapértelmezett fejlécét. */
.form-renderer-surface nav[id$='-header'] {
    display: none !important;
}

.form-renderer-surface .formio-wizard-nav-container {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: flex-end;
    list-style: none;
    border-top: 1px solid #eef1f5;
    margin-top: 30px;
    padding-top: 24px;
}

.form-renderer-surface .formio-wizard-nav-container li {
    list-style: none;
    margin: 0;
    padding: 0;
}

.form-renderer-surface .formio-wizard-nav-container button {
    min-width: 132px;
}

.form-renderer-surface .formio-wizard-nav-container .btn-wizard-nav-cancel {
    margin-right: auto;
}

.application-card .stepper {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.application-card .stepper__item {
    cursor: pointer;
}

.application-card .stepper__item:focus-visible {
    border-radius: 12px;
    outline: 3px solid #dbeafe;
    outline-offset: 3px;
}

.application-card .stepper__item.is-complete .stepper__number {
    background: #e8f0ff;
    color: #2862e8;
}

@media (max-width: 700px) {
    .form-renderer-surface .card-header {
        font-size: 21px;
    }

    .form-renderer-surface .formio-wizard-nav-container {
        align-items: stretch;
        flex-direction: column-reverse;
    }

    .form-renderer-surface .formio-wizard-nav-container li,
    .form-renderer-surface .formio-wizard-nav-container button {
        width: 100%;
    }

    .form-renderer-surface .formio-wizard-nav-container .btn-wizard-nav-cancel {
        margin-right: 0;
    }

    .application-card .stepper {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}
