/*
    create-form-modal.css
*/

.cfm-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.cfm-panel {
    background: #ffffff;
    border-radius: 6px;
    width: 77vw;
    height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.3);
    font-family: Roboto, sans-serif;
    color: #424143;
}

/* ── Header (wizard-modal-header) ───────────────────────────────────── */
.cfm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 5px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid #e1dfdd;
    border-radius: 6px 6px 0 0;
    background: #ffffff;
    flex-shrink: 0;
}

.cfm-title {
    margin: 0;
    font-size: 20px;
    font-weight: 500;
    color: #424143;
}

.cfm-close-btn {
    background: none;
    border: none;
    color: #4d4c4f3b;
    font-size: 16px;
    cursor: pointer;
    padding: 4px 6px;
}

    .cfm-close-btn:hover {
        color: #424143;
    }

/* Used by HotspotDetailsModal (2026-08-25, per direct feedback that the
   plain X was too easy to miss) - a filled circular red hover/focus state
   makes it read unambiguously as "close" rather than blending into the
   header. Left as an additive modifier class (not a change to the base
   .cfm-close-btn above) so CreateFormModal's own close button, which
   sits in a denser wizard header, is unaffected. */
.cfm-close-btn-prominent {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #605e5c;
    transition: background-color 0.12s, color 0.12s;
}

    .cfm-close-btn-prominent:hover,
    .cfm-close-btn-prominent:focus-visible {
        background: #d7142c;
        color: #ffffff;
    }

/* ── Tabs (unconfirmed exact theme tokens - kept as reasonable app blue) ── */
.cfm-tab-bar {
    display: flex;
    gap: 4px;
    padding: 0 20px;
    border-bottom: 1px solid #e1dfdd;
    flex-shrink: 0;
}

.cfm-tab-btn {
    padding: 12px 16px;
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    color: #605e5c;
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    cursor: pointer;
    transition: color 0.12s, border-color 0.12s, background-color 0.12s;
}

    .cfm-tab-btn:hover {
        color: #424143;
        background-color: rgba(0, 0, 0, 0.04);
    }

.cfm-tab-active {
    color: #007faa !important;
    border-bottom-color: #007faa !important;
    font-weight: 600;
}

.cfm-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    background: #faf9f8;
}

/* ── Full-panel loading state ────────────────────────────────────────── */
.cfm-loading-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    min-height: 300px;
}

.cfm-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid #e1dfdd;
    border-top-color: #007faa;
    animation: cfm-spin 0.8s linear infinite;
}

@keyframes cfm-spin {
    to {
        transform: rotate(360deg);
    }
}

.cfm-loading-text {
    font-size: 13px;
    color: #605e5c;
}

/* ── Sections (mat-expansion-panel) ──────────────────────────────────── */
.cfm-section {
    background: #ffffff;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    margin-bottom: 12px;
    overflow: visible;
    width: 100%;
}

.cfm-section-header {
    height: 38px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 14px;
    background: #ebedf0;
    border-bottom: 1px solid #e1dfdd;
    border-radius: 3px 3px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #424143;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.12s;
}

    .cfm-section-header:hover {
        background: #dfe2e6;
    }

.cfm-section-header-collapsed {
    border-radius: 3px;
    border-bottom: none;
}

.cfm-section-header-title {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    flex-grow: 1;
    padding-right: 12px;
}

.cfm-section-arrow {
    flex-shrink: 0;
    margin-left: 12px;
    font-size: 12px;
    color: #605e5c;
    transition: transform 0.3s ease;
}

.cfm-section-arrow-collapsed {
    transform: rotate(180deg);
}

.cfm-section-body {
    padding: 16px 14px 14px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.cfm-line {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.cfm-field {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    flex: 1;
    min-width: 280px;
}

.cfm-field--ens {
    align-items: center;
}

    .cfm-field--ens .cfm-field-label {
        padding-top: 0;
        min-height: 0;
    }

.cfm-field-label {
    width: 200px;
    min-width: 200px;
    min-height: 34px;
    margin-right: 10px;
    padding-top: 10px;
    padding-right: 12px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.1;
    color: #444;
    text-align: right;
    flex-shrink: 0;
}

.cfm-required {
    color: #d7142c;
    margin-left: 2px;
}

.cfm-field-control {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    gap: 4px;
    padding-top: 0;
}

.cfm-input, .cfm-select, .cfm-textarea {
    width: 270px;
    height: 34px;
    padding: 0 8px;
    border: 1px solid #cfd6dd;
    border-radius: 2px;
    font-family: inherit;
    font-size: 14px;
    color: #424143;
    background: #ffffff;
}

    .cfm-input:disabled, .cfm-select:disabled, .cfm-textarea:disabled {
        background: #e6e6e6;
        color: gray;
        opacity: .7;
    }

.cfm-textarea {
    width: 100%;
    max-width: 720px;
    min-width: 180px !important;
    height: auto;
    min-height: 100px;
    resize: vertical;
    padding: 8px 8px 0;
    border: 1px solid #cad0d7;
    background-color: inherit;
    color: inherit;
    font-family: inherit;
    font-size: inherit;
}

.cfm-line-multiple .cfm-input,
.cfm-line-multiple .cfm-select {
    width: auto;
    min-width: 150px !important;
    max-width: 200px;
}

.cfm-line-multiple .cfm-field {
    min-width: 0;
    flex: 0 1 auto;
}

/* ── ENS name segments (Outgoing action prefix / contract / sequence) ── */
.cfm-ens-preview {
    display: flex;
    align-items: flex-end;
    gap: 28px;
}

.cfm-ens-segment {
    display: flex;
    flex-direction: column;
    gap: 2px;
    position: relative;
}

    .cfm-ens-segment:last-child {
        border-right: none;
    }

.cfm-ens-segment-label {
    font-size: 14px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 220px;
}

.cfm-ens-segment-value {
    display: flex;
    align-items: center;
    box-sizing: border-box;
    padding: 0 5px;
    line-height: 1.1;
    background: #e6e6e6;
    border: 1px solid #cfd6dd;
    border-radius: 2px;
    font-size: 13px;
    color: gray;
    opacity: .7;
    min-width: 60px;
    height: 34px;
}

.cfm-ens-segment:not(:last-child)::after {
    content: "";
    position: absolute;
    right: -28px;
    bottom: 16px;
    width: 28px;
    height: 2px;
    background-color: #b3b0ad;
}

.cfm-checkbox-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cfm-checklist {
    max-height: 160px;
    overflow-y: auto;
    border: 1px solid #cfd6dd;
    border-radius: 2px;
    padding: 6px 8px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.cfm-checklist-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
}

.cfm-checklist-select-all {
    font-weight: 600;
    border-bottom: 1px solid #e1dfdd;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.cfm-stub-note {
    font-size: 11px;
    color: #a19f9d;
    font-style: italic;
}

.cfm-loading-note {
    font-size: 11px;
    color: #007faa;
}

.cfm-chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 6px;
}

.cfm-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: #eff6fc;
    color: #424143;
    border: 1px solid #c7e0f4;
    border-radius: 12px;
    padding: 2px 6px 2px 10px;
    font-size: 12px;
}

.cfm-chip-remove {
    background: none;
    border: none;
    color: #605e5c;
    cursor: pointer;
    font-size: 13px;
    line-height: 1;
    padding: 0 2px;
}

    .cfm-chip-remove:hover {
        color: #a4262c;
    }

.cfm-suggestion-list {
    margin-top: 4px;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    max-height: 160px;
    overflow-y: auto;
    background: #ffffff;
}

.cfm-suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    background: none;
    border: none;
    padding: 6px 8px;
    font-size: 12px;
    cursor: pointer;
}

    .cfm-suggestion-item:hover {
        background: #f3f2f1;
    }

/* ── CC User / relationship-filter live search ───────────────────────── */
.cfm-search-input-row {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cfm-search-wrapper {
    max-width: 310px;
}

.cfm-search-input-row .cfm-input {
    flex: 1;
    width: auto;
    border-color: #dce0e5;
}

.cfm-search-count-badge {
    background: #f3f2f1;
    border: 1px solid #e1dfdd;
    border-radius: 3px;
    padding: 3px 7px;
    font-size: 11px;
    font-weight: 600;
    color: #605e5c;
}

.cfm-search-go-btn {
    background: #2e74c6;
    border: none;
    border-radius: 3px;
    color: #ffffff;
    width: 34px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
}

    .cfm-search-go-btn:hover:not(:disabled) {
        background: #5c93d4;
    }

    .cfm-search-go-btn:disabled {
        background: #c8e0f4;
        cursor: default;
    }

.cfm-autocomplete-list {
    display: flex;
    flex-direction: column;
    max-height: 180px;
    overflow-y: auto;
}

.cfm-autocomplete-item {
    background: none;
    border: none;
    text-align: left;
    padding: 6px 4px;
    font-size: 13px;
    color: #424143;
    cursor: pointer;
    border-radius: 2px;
}

    .cfm-autocomplete-item:hover {
        background: #f3f2f1;
    }

.cfm-search-panel {
    margin-top: 2px;
    background: #ffffff;
    border: 1px solid #a9b4be;
    border-radius: 2px;
    min-width: 245px;
    min-height: 54px;
    padding: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.cfm-search-header {
    font-size: 11px;
    color: #a19f9d;
    border-bottom: 1px solid #f3f2f1;
    padding-bottom: 4px;
}

.cfm-search-hint {
    padding: 8px 2px;
}

.cfm-search-checklist {
    max-height: 180px;
}

.cfm-search-footer {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 12px;
    border-top: 1px solid #f3f2f1;
    padding-top: 6px;
}

.cfm-search-count-text {
    margin-right: auto;
    font-size: 11px;
    color: #a19f9d;
}

.cfm-btn-add, .cfm-btn-filter {
    background: none;
    border: none;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    padding: 2px 4px;
}

.cfm-btn-add {
    color: #007faa;
}

    .cfm-btn-add:disabled {
        color: #c8e0f4;
        cursor: default;
    }

.cfm-btn-filter {
    color: #007faa;
}

.cfm-btn-reset {
    color: #a4262c;
}

.cfm-btn-filter-active {
    font-weight: 700;
}

.cfm-filter-operator-row {
    font-weight: 600;
    border-bottom: 1px solid #e1dfdd;
    padding-bottom: 4px;
    margin-bottom: 2px;
}

.cfm-checklist-item-added {
    color: #a19f9d;
    font-style: italic;
}

.cfm-filter-error {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
}

/* ── Validation feedback ──────────────────────────────────────────────── */
.cfm-validation-banner {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 14px;
    padding: 10px 14px;
    border: 1px solid #f3c1c6;
    border-radius: 3px;
    background: #fdf1f1;
    color: #a4262c;
    font-size: 13px;
    font-weight: 600;
}

.cfm-field-invalid .cfm-field-label {
    color: #d7142c;
}

.cfm-field-invalid .cfm-input,
.cfm-field-invalid .cfm-select,
.cfm-field-invalid .cfm-textarea,
.cfm-field-invalid .cfm-checklist,
.cfm-field-invalid .cfm-search-input-row .cfm-input {
    border-color: #d7142c;
    box-shadow: 0 0 0 1px #d7142c;
}

.cfm-field-invalid .cfm-field-control {
    outline: 1px solid #f3c1c6;
    outline-offset: 4px;
    border-radius: 3px;
}

/* ── Footer (uxt-wizard__footer) ─────────────────────────────────────── */
.cfm-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
    padding: 14px 20px;
    border-top: 1px solid #cad0d7;
    border-radius: 0 0 6px 6px;
    flex-shrink: 0;
    background: #faf9f8;
}

.cfm-footer-actions {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

/* ── Wizard pager ("< Step 1 of 2 >") ─────────────────────────────────── */
.cfm-pager {
    display: flex;
    align-items: center;
    gap: 12px;
}

.cfm-pager-label {
    font-size: 13px;
    font-weight: 600;
    color: #5c5c5c;
    min-width: 90px;
    text-align: center;
}

.cfm-pager-btn {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #cacaca;
    border-radius: 3px;
    background: #f1f1f1;
    color: #5c5c5c;
    cursor: pointer;
    transition: all 175ms cubic-bezier(.1, .65, .1, .65);
}

    .cfm-pager-btn:hover:not(:disabled) {
        background: #d0d0d0;
        border-color: #9e9e9ecc;
    }

    .cfm-pager-btn:disabled {
        color: #c8c8c8;
        background: #f7f7f7;
        border-color: #e1dfdd;
        cursor: default;
    }

/* ── Step 2: file upload page ─────────────────────────────────────────── */
.cfm-newfiles-label {
    font-size: 15px;
    font-weight: 600;
    color: #323130;
    margin-bottom: 10px;
}

.cfm-filesource-tab-bar {
    border-bottom: 1px solid #e1dfdd;
    margin-bottom: 16px;
}

.cfm-filesource-tab {
    position: relative;
    display: inline-block;
    padding: 8px 4px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: .02em;
    text-transform: uppercase;
    color: #a19f9d;
}

.cfm-filesource-tab-active {
    color: #007faa;
    border-bottom: 2px solid #007faa;
}

.cfm-filesource-tab-badge {
    position: absolute;
    top: -6px;
    right: -16px;
    min-width: 16px;
    height: 16px;
    padding: 0 3px;
    border-radius: 50%;
    background: #007faa;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 16px;
    text-align: center;
    text-transform: none;
    letter-spacing: normal;
}

.cfm-upload-layout {
    display: flex;
    align-items: stretch;
    gap: 20px;
}

.cfm-dropzone {
    position: relative;
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 400px;
    border: 2px dashed #cad0d7;
    border-radius: 4px;
    background: #fafafa;
    transition: border-color 150ms ease, background 150ms ease;
}

.cfm-dropzone-active {
    border-color: #007faa;
    background: #eef7fb;
}

.cfm-dropzone-input {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    cursor: pointer;
}

.cfm-dropzone-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    pointer-events: none;
}

.cfm-dropzone-icon {
    font-size: 32px;
    color: #a19f9d;
    margin-bottom: 4px;
}

.cfm-dropzone-text {
    font-size: 14px;
    color: #424143;
}

.cfm-dropzone-or {
    font-size: 12px;
    color: #a19f9d;
}

.cfm-btn-choose-files {
    margin-top: 6px;
}

/* ── Upload panel (right column) ──────────────────────────────────────── */
.cfm-upload-panel {
    flex: 1;
    min-width: 0;
    height: 400px;
    display: flex;
    flex-direction: column;
    border: 1px solid #e1dfdd;
    border-radius: 4px;
    background: #ffffff;
}

.cfm-upload-panel-empty {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    color: #a19f9d;
    font-size: 13px;
}

.cfm-upload-panel-header {
    padding: 10px 14px;
    background: #f3f2f1;
    border-bottom: 1px solid #e1dfdd;
    border-radius: 4px 4px 0 0;
    font-size: 13px;
    font-weight: 600;
    color: #424143;
}

.cfm-upload-table-head {
    display: flex;
    padding: 8px 14px;
    border-bottom: 1px solid #e1dfdd;
    font-size: 12px;
    font-weight: 700;
    color: #424143;
}

.cfm-upload-col-name,
.cfm-upload-col-progress {
    display: flex;
    align-items: center;
    gap: 6px;
}

.cfm-upload-col-name {
    flex: 1;
}

.cfm-upload-col-progress {
    width: 180px;
}

.cfm-upload-table-body {
    flex: 1;
    overflow-y: auto;
    border-radius: 0 0 4px 4px;
}

.cfm-upload-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #f3f2f1;
}

.cfm-upload-row-name {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 8px;
}

.cfm-upload-row-icon {
    color: #a19f9d;
    flex-shrink: 0;
}

.cfm-upload-row-name-text {
    min-width: 0;
}

.cfm-upload-row-filename {
    font-size: 13px;
    color: #424143;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cfm-upload-row-size {
    font-size: 11px;
    color: #a19f9d;
}

.cfm-upload-row-progress {
    width: 180px;
    flex-shrink: 0;
}

.cfm-progress-track {
    width: 100%;
    height: 18px;
    border-radius: 3px;
    background: #e1dfdd;
    overflow: hidden;
}

.cfm-progress-fill {
    height: 100%;
    min-width: 28px;
    background: #4c9a2a;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    line-height: 18px;
    text-align: center;
    white-space: nowrap;
    transition: width 200ms ease;
}

.cfm-upload-status {
    margin-top: 4px;
    font-size: 11px;
    color: #a19f9d;
}

.cfm-upload-error {
    font-size: 12px;
    color: #a4262c;
}

.cfm-upload-row-remove {
    flex-shrink: 0;
    border: none;
    background: transparent;
    color: #605e5c;
    cursor: pointer;
    padding: 4px;
}

    .cfm-upload-row-remove:hover {
        color: #d7142c;
    }

.cfm-rejected-files {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 12px;
}

.cfm-rejected-file-row {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #f3c1c6;
    border-radius: 3px;
    background: #fdf1f1;
    color: #a4262c;
    font-size: 13px;
}

/* Multi-reason list shown inside cfm-rejected-file-row - see ErrorModal's
Reasons parameter (currently only used by SidePanel's Complete validation,
where more than one requirement can fail at once). */
.cfm-error-reasons {
    margin: 6px 0 0;
    padding-left: 18px;
}

    .cfm-error-reasons li {
        margin-top: 2px;
    }

.cfm-btn {
    min-width: 100px;
    padding: 8px 20px;
    border: 1px solid #cacaca;
    border-radius: 3px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 600;
    color: #5c5c5c;
    background: #f1f1f1;
    cursor: pointer;
    transition: all 175ms cubic-bezier(.1, .65, .1, .65);
}

    .cfm-btn:hover {
        background: #d0d0d0;
        border-color: #9e9e9ecc;
    }

.cfm-btn-cancel {
    color: #d7142c;
    background: transparent;
    border-color: transparent;
}

    .cfm-btn-cancel:hover {
        background: #b51125;
        color: #ffffff;
        border-color: #b51125cc;
    }

.cfm-btn-secondary {
    color: #5c5c5c;
    background: #f1f1f1;
}

.cfm-btn-primary {
    background: #007faa;
    color: #ffffff;
    border-color: #006c91;
}

    .cfm-btn-primary:hover {
        background: #006691;
        border-color: #005478;
    }

/* ── Responsive layout (narrow viewport) ───────────────────────────── */
@media (max-width: 1100px) {
    .cfm-panel {
        width: 95vw;
    }

    .cfm-field {
        flex-direction: column;
        align-items: stretch;
        width: 100%;
        min-width: 0;
    }

    .cfm-field-label {
        width: 100%;
        min-width: 0;
        text-align: left;
        padding-top: 0;
        padding-right: 0;
        margin-right: 0;
        margin-bottom: 4px;
    }

    .cfm-field--ens .cfm-field-label {
        margin-bottom: 10px;
    }

    .cfm-upload-layout {
        flex-direction: column;
    }

    .cfm-dropzone,
    .cfm-upload-panel {
        height: 260px;
    }

    .cfm-input, .cfm-select, .cfm-textarea {
        width: 100%;
        max-width: 100%;
    }

    .cfm-line-multiple .cfm-field {
        flex: 1 1 100%;
        width: 100%;
    }

    .cfm-line-multiple .cfm-input,
    .cfm-line-multiple .cfm-select {
        max-width: 100%;
        min-width: 0 !important;
    }

    .cfm-search-input-row .cfm-input {
        width: auto;
    }

    .cfm-ens-preview {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }

    .cfm-ens-segment {
        width: 100%;
    }

        .cfm-ens-segment:not(:last-child)::after {
            display: none;
        }

    .cfm-ens-segment-value {
        width: 100%;
    }
}

/* ── ConfirmModal ────────────────────────────────────────────────────── */
.cfm-panel-confirm {
    width: 420px;
    height: auto;
}

.cfm-confirm-body {
    padding: 20px;
}

.cfm-confirm-message {
    margin: 0;
    font-size: 14px;
    line-height: 1.5;
    color: #424143;
}

.cfm-btn-danger {
    color: #d7142c;
    background: transparent;
    border-color: transparent;
}

    .cfm-btn-danger:hover {
        background: #b51125;
        color: #ffffff;
        border-color: #b51125cc;
    }

@media (max-width: 480px) {
    .cfm-panel-confirm {
        width: 92vw;
    }
}
