/* Modal overlay */
.cp-form-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.cp-form-modal--open {
    display: flex;
}

.cp-form-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .5);
}

.cp-form-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 10px;
    width: min(800px, calc(100vw - 32px));
    max-height: calc(100vh - 48px);
    display: flex;
    flex-direction: column;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.cp-form-modal__close {
    position: absolute;
    top: 12px;
    right: 14px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 4px;
}

.cp-form-modal__close:hover {
    background: #f3f4f6;
    color: #111;
}

.cp-form-modal__body {
    overflow-y: auto;
    padding: 40px 36px 32px;
}

/* Form */
.cp-center-form {
    font-family: inherit;
}

.cp-center-form__notice {
    color: #6b7280;
    font-style: italic;
}

/* Progress bar */
.cp-center-form__progress {
    display: flex;
    gap: 8px;
    margin-bottom: 28px;
    flex-wrap: wrap;
}

.cp-center-form__step-indicator {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 4px;
    background: #e5e7eb;
    font-size: 14px;
    cursor: default;
}

.cp-center-form__step-indicator--active {
    background: #0069AF;
    color: #fff;
}

.cp-center-form__step-number {
    font-weight: 700;
}

/* Steps */
.cp-center-form__step {
    display: none;
}

.cp-center-form__step--active {
    display: block;
}

.cp-center-form__step-title {
    margin: 0 0 20px;
    font-size: 22px;
}

/* Sections */
.cp-center-form__section {
    margin-bottom: 24px;
}

.cp-center-form__section-heading {
    margin: 0 0 12px;
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid #e5e7eb;
    padding-bottom: 6px;
}

/* Fields */
.cp-center-form__field {
    margin-bottom: 18px;
}

.cp-center-form__field-label {
    display: block;
    font-weight: 500;
    margin-bottom: 5px;
    font-size: 14px;
}

.cp-center-form__field-instructions {
    font-size: 12px;
    color: #6b7280;
    margin: 0 0 4px;
}

.cp-center-form__file-current {
    font-size: 12px;
    color: #6b7280;
    margin-bottom: 4px;
}

/* Inputs */
.cp-center-form__input-group {
    display: flex;
    align-items: center;
}

.cp-center-form__input-group .cp-center-form__input {
    border-radius: 4px 0 0 4px;
}

.cp-center-form__input-append {
    padding: 0 10px;
    background: #f3f4f6;
    border: 1px solid #d1d5db;
    border-left: none;
    height: 38px;
    line-height: 38px;
    font-size: 14px;
    border-radius: 0 4px 4px 0;
    white-space: nowrap;
}

.cp-center-form__input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    height: 38px;
    box-sizing: border-box;
}

/* Radio */
.cp-center-form__radio-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.cp-center-form__radio-item {
    margin-bottom: 6px;
}

.cp-center-form__radio-label {
    font-weight: normal;
    font-size: 14px;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    cursor: pointer;
}

/* Navigation */
.cp-center-form__navigation {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 32px;
}

.cp-center-form__navigation-left,
.cp-center-form__navigation-right {
    display: flex;
    gap: 8px;
    align-items: center;
}

/* =========================================================================
   Shared button component — cp-btn
   Use these classes everywhere instead of component-scoped btn classes.
   ========================================================================= */

.cp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 22px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    text-decoration: none;
    white-space: nowrap;
    line-height: 1.4;
    box-sizing: border-box;
    transition: opacity .15s, background .15s;
}

.cp-btn:hover {
    opacity: .88;
}

.cp-btn--primary {
    background: #0069AF;
    color: #fff;
}

.cp-btn--secondary {
    background: #cacbcc;
    color: #111;
}

.cp-btn--action {
    background: #FFCF06;
    color: #111;
}

.cp-btn--outline {
    background: #f3f4f6;
    color: #374151;
    border: 1px solid #d1d5db;
}

.cp-btn--danger {
    background: #dc2626;
    color: #fff;
}

.cp-btn--danger:hover {
    background: #b91c1c;
    opacity: 1;
}

.cp-btn--danger-outline {
    background: #fff;
    color: #dc2626;
    border: 1px solid #fca5a5;
}

.cp-btn--danger-outline:hover {
    background: #fef2f2;
    opacity: 1;
}

.cp-btn--ghost {
    background: none;
    border: none;
    padding: 0;
    border-radius: 0;
    color: #6b7280;
    font-size: 13px;
    font-weight: 400;
    text-decoration: underline;
}

.cp-btn--ghost:hover {
    color: #111;
    opacity: 1;
}

.cp-btn--icon {
    padding: 0;
    width: 34px;
    height: 34px;
    font-size: 20px;
    line-height: 1;
    flex-shrink: 0;
    border-radius: 6px;
}

.cp-btn--full {
    width: 100%;
}

/* Save button loader */
.cp-center-form__save-loader {
    display: inline-block;
    width: 72px;
    height: 12px;
    border-radius: 20px;
    color: #374151;
    border: 2px solid currentColor;
    position: relative;
    vertical-align: middle;
}

.cp-center-form__save-loader::before {
    content: "";
    position: absolute;
    margin: 2px;
    inset: 0 100% 0 0;
    border-radius: inherit;
    background: currentColor;
    animation: cp-save-loader 1.5s infinite;
}

@keyframes cp-save-loader {
    100% {
        inset: 0;
    }
}

/* Draft saved indicator */
.cp-center-form__draft-indicator {
    display: none;
    align-items: center;
    gap: 5px;
    font-size: 13px;
    color: #E6E7F5;
    font-weight: 500;
}

.cp-center-form__draft-indicator:not([hidden]) {
    display: inline-flex;
}

/* Validation error */
.cp-field-error {
    display: block;
    margin-top: 4px;
    font-size: 12px;
    color: #dc2626;
}

/* Tag / pill input */
.cp-tag-input {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    align-items: center;
    min-height: 38px;
    padding: 4px 8px;
    border: 1px solid #d1d5db;
    border-radius: 4px;
    background: #fff;
    cursor: text;
    box-sizing: border-box;
}

.cp-tag-input:focus-within {
    border-color: #0069AF;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, .15);
}

.cp-tag-input__pill {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 2px 8px 2px 10px;
    background: #dbeafe;
    color: #1e40af;
    border-radius: 12px;
    font-size: 13px;
    white-space: nowrap;
}

.cp-tag-input__pill-remove {
    background: none;
    border: none;
    cursor: pointer;
    color: #1e40af;
    padding: 0;
    font-size: 16px;
    line-height: 1;
    opacity: .6;
}

.cp-tag-input__pill-remove:hover {
    opacity: 1;
}

.cp-tag-input__text {
    border: none;
    outline: none;
    font-size: 14px;
    flex: 1;
    min-width: 140px;
    padding: 2px 0;
    background: transparent;
}

/* Tom Select — city field */
.cp-center-form .ts-wrapper {
    width: 100%;
}

.cp-center-form .ts-control {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    min-height: 38px;
    padding: 4px 10px;
    box-shadow: none;
}

.cp-center-form .ts-wrapper.focus .ts-control {
    border-color: #0069AF;
    box-shadow: 0 0 0 2px rgba(29, 78, 216, .15);
}

.cp-center-form .ts-dropdown {
    border: 1px solid #d1d5db;
    border-radius: 4px;
    font-size: 14px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, .1);
}

.cp-center-form .ts-dropdown .option.selected,
.cp-center-form .ts-dropdown .option:hover {
    background: #eff6ff;
    color: #0069AF;
}

/* Success / notice */
.cp-center-form__success {
    padding: 16px;
    background: #d1fae5;
    border-radius: 6px;
    color: #065f46;
}

.cp-center-form__success--draft {
    background: #eff6ff;
    color: #1e40af;
}

/* =========================================================================
   Register Modal
   ========================================================================= */

.reg-modal {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    align-items: center;
    justify-content: center;
}

.reg-modal--open {
    display: flex;
}

.reg-modal__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .55);
}

.reg-modal__dialog {
    position: relative;
    z-index: 1;
    background: #fff;
    border-radius: 12px;
    width: min(960px, 94vw);
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 20px 60px rgba(0, 0, 0, .25);
}

.reg-modal__close {
    position: absolute;
    top: 14px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    color: #6b7280;
    padding: 4px 8px;
    border-radius: 4px;
    z-index: 2;
}

.reg-modal__close:hover {
    color: #111;
    background: #f3f4f6;
}

.reg-modal__body {
    display: grid;
    grid-template-columns: 1fr 1fr;
    min-height: 400px;
}

.reg-modal__info {
    padding: 48px 40px;
    background: #f8fafc;
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.reg-modal__info-title {
    font-size: 22px;
    font-weight: 700;
    margin: 0;
}

.reg-modal__info-content {
    font-size: 15px;
    line-height: 1.6;
    color: #374151;
}

.reg-modal__form {
    padding: 48px 40px;
}

@media (max-width: 680px) {
    .reg-modal__body {
        grid-template-columns: 1fr;
    }

    .reg-modal__info {
        border-radius: 12px 12px 0 0;
        padding: 32px 24px 24px;
    }

    .reg-modal__form {
        padding: 24px;
    }
}

/* UM center-field remove button */
.cp-center-field-area {
    display: flex;
    align-items: center;
    gap: 8px;
}

.cp-center-field-area input {
    flex: 1;
    min-width: 0;
}

.cp-remove-center {
    flex-shrink: 0;
    font-size: 13px;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}

.cp-remove-center:hover {
    color: #dc2626;
    text-decoration: underline;
}

.cp-add-center {
    display: inline-block;
    margin-top: 6px;
    font-size: 13px;
    color: #0069AF;
    text-decoration: none;
}

.cp-add-center:hover {
    text-decoration: underline;
}

/* Client-side field errors */
.reg-field-error {
    display: block;
    font-size: 12px;
    color: #dc2626;
    margin-top: 4px;
}

.reg-field-error--input {
    border-color: #dc2626 !important;
    outline: none;
}

/* Page-level status notice */
.reg-notice {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    border-radius: 8px;
    font-size: 14px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, .15);
    max-width: min(520px, 90vw);
    background: #1e293b;
    color: #fff;
}

.reg-notice[hidden] {
    display: none;
}

.reg-notice--success {
    background: #065f46;
}

.reg-notice--error {
    background: #7f1d1d;
}

.reg-notice__text {
    flex: 1;
}

.reg-notice__close {
    background: none;
    border: none;
    color: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
    opacity: .7;
    padding: 0 4px;
    flex-shrink: 0;
}

.reg-notice__close:hover {
    opacity: 1;
}
