:root {
    --register-green: #3f9658;
    --register-green-dark: #317844;
    --register-teal: #27b4b5;
    --register-text: #1f2937;
    --register-muted: #687681;
    --register-border: #d7dee3;
    --register-error: #b42318;
}

html,
body {
    min-height: 100%;
}

body {
    display: flex;
    min-height: 100vh;
    flex-direction: column;
    background-color: #eef3f1;
    background-image: linear-gradient(rgba(238, 243, 241, .86), rgba(238, 243, 241, .86)), url('/static/images/fundoCED.png') !important;
}

body > nav,
body > footer {
    flex: 0 0 auto;
}

.register-page {
    display: flex;
    width: 100%;
    flex: 1 0 auto;
    align-items: flex-start;
    justify-content: center;
    padding: 38px 20px 48px;
}

.register-card {
    width: 100%;
    max-width: 900px;
    overflow: hidden;
    border: 1px solid #e2e8ec;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 8px 24px rgba(23, 46, 34, .08);
}

.register-card__header {
    padding: 28px 32px 22px;
    border-bottom: 1px solid #e7ecef;
    background: linear-gradient(135deg, rgba(63, 150, 88, .1), rgba(39, 180, 181, .08));
}

.register-card__header h1 {
    margin: 0 0 5px;
    color: var(--register-text);
    font-size: 28px;
    font-weight: 700;
    line-height: 1.2;
}

.register-card__header p {
    margin: 0;
    color: var(--register-muted);
    font-size: 15px;
}

.register-form {
    padding: 28px 32px 30px;
}

.register-form__grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 22px 24px;
}

.register-field {
    min-width: 0;
}

.register-field > label,
.register-field__label-row label {
    display: block;
    margin: 0 0 7px;
    color: #34414a;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.3;
}

.register-field .form-control,
.register-field input[type='file'],
.register-field .select2-container .select2-selection--single {
    width: 100%;
    min-height: 46px;
    border: 1px solid var(--register-border) !important;
    border-radius: 8px !important;
    background: #fff !important;
    color: var(--register-text);
    font-size: 14px;
    box-shadow: none !important;
}

.register-field .form-control {
    padding: 10px 12px;
}

.register-field select.form-control {
    padding-right: 42px;
    appearance: none;
    -webkit-appearance: none;
    background-color: #fff !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23168a91' stroke-width='2.25' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 13px center !important;
    background-size: 18px 18px !important;
    cursor: pointer;
}

.register-field select.form-control:hover {
    border-color: #a9c8c1 !important;
    background-color: #fbfefd !important;
}

.register-field .form-control:focus,
.register-field input[type='file']:focus,
.register-field .select2-container--focus .select2-selection--single,
.register-field .select2-container--open .select2-selection--single {
    border-color: var(--register-green) !important;
    outline: 3px solid rgba(63, 150, 88, .18) !important;
    outline-offset: 1px;
}

.register-field .select2-container {
    width: 100% !important;
}

.register-field .select2-selection__rendered {
    padding: 8px 38px 8px 12px !important;
    color: var(--register-text) !important;
    line-height: 28px !important;
}

.register-field .select2-selection__arrow {
    top: 8px !important;
    right: 10px !important;
    width: 26px !important;
    height: 28px !important;
}

.register-field .select2-selection__arrow b {
    width: 9px !important;
    height: 9px !important;
    margin-top: -7px !important;
    margin-left: -6px !important;
    border: 0 !important;
    border-right: 2px solid #168a91 !important;
    border-bottom: 2px solid #168a91 !important;
    transform: rotate(45deg);
    transition: transform .2s ease;
}

.register-field .select2-container--open .select2-selection__arrow b {
    margin-top: -2px !important;
    transform: rotate(225deg);
}

.select2-dropdown {
    overflow: hidden;
    border: 1px solid #b9d2cc !important;
    border-radius: 8px !important;
    background: #fff;
    box-shadow: 0 8px 20px rgba(31, 65, 50, .12);
}

.select2-search--dropdown {
    padding: 9px !important;
}

.select2-search--dropdown .select2-search__field {
    min-height: 40px;
    padding: 8px 10px;
    border: 1px solid var(--register-border) !important;
    border-radius: 7px;
    outline: none;
}

.select2-search--dropdown .select2-search__field:focus {
    border-color: var(--register-green) !important;
    box-shadow: 0 0 0 3px rgba(63, 150, 88, .16);
}

.select2-results__option {
    padding: 9px 12px !important;
    color: var(--register-text) !important;
    font-size: 14px;
}

.select2-results__option--highlighted[aria-selected] {
    background: #eaf7f2 !important;
    color: #24693a !important;
}

.select2-results__option[aria-selected='true'] {
    background: var(--register-teal) !important;
    color: #fff !important;
}

.register-password {
    position: relative;
}

.register-password .form-control {
    padding-right: 48px;
}

.register-password__toggle {
    position: absolute;
    top: 50%;
    right: 6px;
    display: inline-flex;
    width: 38px;
    height: 38px;
    padding: 0;
    align-items: center;
    justify-content: center;
    border: 0;
    border-radius: 7px;
    background: transparent;
    color: #65747d;
    cursor: pointer;
    transform: translateY(-50%);
}

.register-password__toggle:hover {
    background: #edf7f1;
    color: var(--register-green-dark);
}

.register-password__toggle:focus-visible {
    outline: 3px solid rgba(63, 150, 88, .25);
}

.register-password__toggle i {
    font-size: 20px;
}

.register-field__help,
.register-field__error {
    margin: 6px 0 0;
    font-size: 12px;
    line-height: 1.4;
}

.register-field__help {
    color: var(--register-muted);
}

.register-field__error {
    color: var(--register-error);
    font-weight: 500;
}

.register-field.has-error .form-control,
.register-field.has-error input[type='file'],
.register-field.has-error .select2-selection--single {
    border-color: var(--register-error) !important;
}

.register-error-summary,
.register-form__non-field-errors {
    margin-bottom: 22px;
    padding: 11px 13px;
    border: 1px solid #f1b4ae;
    border-radius: 8px;
    background: #fff2f0;
    color: #8f1d14;
    font-size: 13px;
}

.register-error-summary {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 600;
}

.register-error-summary i {
    font-size: 20px;
}

.register-form__non-field-errors ul {
    margin: 0;
    padding-left: 18px;
}

.register-field--photo {
    grid-column: 1 / -1;
    padding-top: 2px;
}

.register-field__label-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.register-field__label-row span {
    color: var(--register-muted);
    font-size: 12px;
}

.register-photo {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px;
    border: 1px dashed #bdc9ce;
    border-radius: 10px;
    background: #fafcfc;
}

.register-photo__preview {
    position: relative;
    display: flex;
    width: 68px;
    height: 68px;
    flex: 0 0 68px;
    overflow: hidden;
    align-items: center;
    justify-content: center;
    border: 2px solid #dce9e2;
    border-radius: 50%;
    background: #edf7f1;
    color: var(--register-green);
}

.register-photo__preview i {
    font-size: 38px;
}

.register-photo__preview img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.register-photo__input {
    min-width: 0;
    flex: 1;
}

.register-field input[type='file'] {
    height: auto;
    padding: 5px;
}

.register-field input[type='file']::file-selector-button {
    min-height: 34px;
    margin-right: 10px;
    padding: 7px 12px;
    border: 0;
    border-radius: 6px;
    background: var(--register-teal);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
}

.register-photo__input small {
    display: block;
    margin-top: 5px;
    color: var(--register-muted);
}

.register-form__actions {
    display: flex;
    margin-top: 28px;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
}

.register-form__actions p {
    margin: 0;
    color: var(--register-muted);
    font-size: 14px;
    order: -1;
}

.register-form__actions a {
    color: var(--register-green-dark);
    font-weight: 700;
    text-decoration: underline;
    text-underline-offset: 3px;
}

.register-submit {
    display: inline-flex;
    min-height: 46px;
    padding: 11px 22px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--register-green);
    border-radius: 8px;
    background: var(--register-green);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: background-color .2s ease, border-color .2s ease, transform .2s ease, box-shadow .2s ease;
}

.register-submit:hover {
    border-color: var(--register-green-dark);
    background: var(--register-green-dark);
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(49, 120, 68, .2);
}

.register-submit:focus-visible {
    outline: 3px solid rgba(63, 150, 88, .28);
    outline-offset: 3px;
}

body > footer {
    width: 100%;
    margin-top: auto !important;
}

@media (max-width: 767px) {
    .register-page {
        padding: 22px 12px 32px;
    }

    .register-card__header,
    .register-form {
        padding-right: 20px;
        padding-left: 20px;
    }

    .register-card__header h1 {
        font-size: 24px;
    }

    .register-form__grid {
        grid-template-columns: minmax(0, 1fr);
        gap: 19px;
    }

    .register-field--photo {
        grid-column: 1;
    }

    .register-form__actions {
        align-items: stretch;
        flex-direction: column;
    }

    .register-form__actions p {
        text-align: center;
    }

    .register-submit {
        width: 100%;
    }
}

@media (max-width: 375px) {
    .register-card__header,
    .register-form {
        padding-right: 16px;
        padding-left: 16px;
    }

    .register-photo {
        align-items: stretch;
        flex-direction: column;
    }

    .register-photo__preview {
        align-self: center;
    }
}
