/* ── Account section layout ─────────────────────────────────────── */

.ia-account-menu-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: none;
    border: 1px solid #ccc;
    padding: 8px 14px;
    font-size: 0.9rem;
    color: #424041;
    cursor: pointer;
    margin-top: 1.5rem;
    margin-bottom: 0;
    margin-left: 1rem;
    transition: border-color 0.15s, color 0.15s;
}

.ia-account-menu-btn:hover {
    border-color: rgb(223, 39, 45);
    color: rgb(223, 39, 45);
}

.ia-account-layout {
    display: flex;
    align-items: flex-start;
    padding-top: 1.5rem;
    padding-bottom: 3rem;
}

/* ── Sidebar ─────────────────────────────────────────────────────── */

/* Mobile: hidden by default, overlays content when toggled */
@media (max-width: 767.98px) {
    .ia-account-layout {
        position: relative;
    }

    .ia-account-sidebar {
        display: none;
        position: absolute;
        top: 0;
        left: 1rem;
        right: 1rem;
        z-index: 100;
        background: #fff;
        border: 1px solid #e8e8e8;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
        padding: 0.5rem 0;
    }

    .ia-account-sidebar.is-open {
        display: block;
    }

    .ia-account-sidebar .ia-account-nav-list li,
    .ia-account-sidebar .ia-account-nav-list li:first-child {
        border: none;
    }
}

/* Desktop: always-visible inline sidebar */
@media (min-width: 768px) {
    .ia-account-sidebar {
        flex-shrink: 0;
        width: 20%;
        min-width: 140px;
    }
}

/* ── Main content area ───────────────────────────────────────────── */

.ia-account-main {
    flex: 1;
    min-width: 0;
}

@media (min-width: 768px) {
    .ia-account-main {
        padding-left: 2.5rem;
        border-left: 1px solid #e8e8e8;
    }
}

/* ── Sidebar navigation ──────────────────────────────────────────── */

.ia-account-sidebar-title {
    font-size: 1rem;
    font-weight: 600;
    color: #424041;
}

.ia-account-nav-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.ia-account-nav-list li {
    border-bottom: 1px solid #e8e8e8;
}

.ia-account-nav-list li:first-child {
    border-top: 1px solid #e8e8e8;
}

.ia-account-nav-list a {
    display: block;
    padding: 0.4rem 0.75rem;
    color: #424041;
    text-decoration: none;
    font-size: 0.95rem;
    line-height: 1.4;
    transition: color 0.15s;
}

.ia-account-nav-list a:hover {
    color: rgb(223, 39, 45);
    text-decoration: none;
}

.ia-account-nav-current a {
    color: rgb(223, 39, 45);
    font-weight: 600;
}

.ia-account-nav-logout a {
    color: #888;
    font-size: 0.875rem;
}

.ia-account-nav-logout a:hover {
    color: rgb(223, 39, 45);
}

/* ── Profile form ────────────────────────────────────────────────── */

.ia-profile-form {
    max-width: 480px;
}

.ia-profile-section {
    margin-bottom: 2rem;
}

.ia-profile-section h3 {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #888;
    margin-top: 0;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    border-bottom: 1px solid #e0e0e0;
}

.ia-profile-field {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
}

.ia-profile-field > span {
    font-size: 0.875rem;
    font-weight: 600;
    margin-bottom: 0.35rem;
    color: #424041;
}

.ia-profile-field input {
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 2px;
    background: #fff;
    color: #424041;
}

.ia-profile-field input:focus {
    border-color: rgb(223, 39, 45);
    outline: none;
    box-shadow: 0 0 0 2px rgba(223, 39, 45, 0.15);
}

.ia-profile-hint {
    font-size: 0.875rem;
    color: #777;
    margin-bottom: 1rem;
    margin-top: -0.5rem;
}

.ia-profile-submit,
.ia-account--portfolio .acf-form-submit input[type="submit"] {
    background: rgb(223, 39, 45);
    color: #fff;
    border: none;
    padding: 10px 28px;
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
    transition: background 0.15s;
}

.ia-profile-submit:hover,
.ia-account--portfolio .acf-form-submit input[type="submit"]:hover {
    background: rgb(195, 28, 34);
}

/* ── Notices ─────────────────────────────────────────────────────── */

.ia-notice {
    padding: 12px 16px;
    border-radius: 4px;
    margin-bottom: 20px;
}

.ia-notice p:last-child {
    margin-bottom: 0;
}

.ia-notice--success {
    background: #edf7ed;
    border-left: 4px solid #4caf50;
}

.ia-notice--portfolio-saved p {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
}

.ia-notice-view-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-weight: 600;
    color: #2e7d32;
    text-decoration: none;
    white-space: nowrap;
}

.ia-notice-view-link:hover {
    text-decoration: underline;
}

.ia-notice-view-arrow {
    display: inline-block;
    transition: transform 0.15s ease;
}

.ia-notice-view-link:hover .ia-notice-view-arrow {
    transform: translateX(3px);
}

.ia-notice--warning {
    background: #fff8e1;
    border-left: 4px solid #f9a825;
}

.ia-notice--error {
    background: #fde8e8;
    border-left: 4px solid rgb(223, 39, 45);
}

.ia-notice--info {
    background: #e8f4fd;
    border-left: 4px solid #2196f3;
}

.ia-error {
    color: #c62828;
}

/* ── Billing button ──────────────────────────────────────────────── */

.ia-billing-btn {
    display: inline-block;
    padding: 10px 20px;
    background: #424041;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 0.875rem;
    font-weight: 600;
    transition: background 0.15s;
}

.ia-billing-btn:hover {
    background: #333;
    color: #fff !important;
}

/* ── Verification ────────────────────────────────────────────────── */

#ia-verify-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 12px;
}

#ia-code-input {
    font-size: 24px;
    letter-spacing: 6px;
    width: 140px;
    text-align: center;
    padding: 8px;
}

/* ── Tier selection ──────────────────────────────────────────────── */

#ia-tier-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 20px 0;
}

.ia-tier-option {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border: 2px solid #ddd;
    border-radius: 4px;
    cursor: pointer;
}

.ia-tier-option:has(input:checked) {
    border-color: rgb(223, 39, 45);
    background: #fff5f5;
}

.ia-tier-name {
    font-weight: 600;
    flex: 1;
}

.ia-tier-limit {
    color: #666;
    font-size: 14px;
}

.ia-tier-recommendation {
    color: #555;
    font-style: italic;
}

.ia-image-limit-note {
    color: #555;
    font-size: 14px;
    margin-bottom: 8px;
}

/* ── Account headings ────────────────────────────────────────────── */

.ia-account h2 {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

/* ── Account article ─────────────────────────────────────────────── */

.template-account .ia-account-main article {
    padding: 0;
}

@media (max-width: 767.98px) and (orientation: portrait) {
    .template-account .ia-account-main article {
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* ── ACF repeater: restore table layout (theme resets tr to block) ── */

.ia-account .acf-repeater table {
    width: 100%;
}

.ia-account .acf-repeater table tbody tr {
    display: table-row;
}

.ia-account .acf-repeater table tbody tr td {
    display: table-cell;
}

/* ACF repeater add-row button — match ghost button style */
.ia-account .acf-repeater .acf-button[data-event="add-row"],
.ia-account .acf-repeater .acf-repeater-add-row {
    background: transparent !important;
    color: #555 !important;
    border: 2px solid #ccc !important;
    border-radius: 2px !important;
    padding: 7px 18px !important;
    font-size: 0.875rem !important;
    font-weight: 600 !important;
    font-family: inherit !important;
    line-height: 1.2 !important;
    cursor: pointer !important;
    text-decoration: none !important;
    text-transform: none !important;
    box-shadow: none !important;
    transition: border-color 0.15s, color 0.15s !important;
    display: inline-block !important;
    margin-top: 8px !important;
}

.ia-account .acf-repeater .acf-button[data-event="add-row"]:hover,
.ia-account .acf-repeater .acf-repeater-add-row:hover {
    background: transparent !important;
    color: #424041 !important;
    border-color: #424041 !important;
}

/* ── Portfolio gallery: custom grid ─────────────────────────────── */

/* Hide the ACF gallery field — our custom grid replaces it */
.ia-account .acf-field[data-key="field_6a4cab1d8fc70"] {
    display: none !important;
}

.ia-gallery-wrap {
    margin-bottom: 1.5rem;
}

.ia-gallery-instructions {
    font-size: 0.85rem;
    color: #666;
    margin: 0 0 0.75rem;
}

.ia-gallery-box {
    position: relative;
    background: #f0f0f0;
    border-radius: 4px;
    padding: 0.75rem 0.75rem 0;
    margin-bottom: 0.75rem;
    min-height: 160px;
}

/* ── Gallery sections ─────────────────────────────────────────── */

.ia-gallery-section {
    padding-bottom: 0.75rem;
}

.ia-gallery-section--library {
    border-top: 1px solid #dedede;
    padding-top: 0.75rem;
}

.ia-gallery-section-header {
    display: flex;
    align-items: baseline;
    gap: 0.6rem;
    margin-bottom: 0.4rem;
}

.ia-gallery-section-title {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.09em;
    color: #424041;
    margin: 0;
}

.ia-gallery-section-sub {
    font-size: 0.78rem;
    color: #888;
    margin: 0;
    line-height: 1.4;
}

/* ── Portfolio wrapper: static slot layer + absolute item overlay ─ */

.ia-gallery-portfolio-wrapper {
    position: relative;
}

.ia-gallery-slots-bg {
    pointer-events: none;
}

.ia-gallery-grid--portfolio {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    min-height: 100%;
    align-content: start;
}

/* ── Empty portfolio slot ─────────────────────────────────────── */

.ia-gallery-slot {
    aspect-ratio: 1 / 1;
    border-radius: 6px;
    background: #ebebeb;
    border: 2px dashed #c8c8c8;
    position: relative;
}

.ia-gallery-slot::after {
    content: attr(data-slot);
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 600;
    color: #c8c8c8;
}

/* ── Drag ghost (placeholder in destination) ──────────────────── */

.ia-gallery-item--ghost {
    opacity: 0.35;
}

/* ── Empty library drop target ────────────────────────────────── */

.ia-gallery-grid--library {
    min-height: 80px;
}

.ia-gallery-grid--library-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #d0d0d0;
    border-radius: 6px;
    background: #f7f7f7;
}

/* ── Library + trash use more columns so items are genuinely smaller ── */

.ia-gallery-grid.ia-gallery-grid--library,
.ia-gallery-grid.ia-gallery-grid--trash {
    grid-template-columns: repeat(5, minmax(0, 1fr));
}

@media (max-width: 575.98px) {
    .ia-gallery-grid.ia-gallery-grid--library,
    .ia-gallery-grid.ia-gallery-grid--trash {
        grid-template-columns: repeat(4, minmax(0, 1fr));
    }
}

/* ── Trash section ────────────────────────────────────────────── */

.ia-gallery-section--trash {
    border-top: 1px solid #f0d0d0;
    padding-top: 0.75rem;
}

.ia-gallery-section--trash .ia-gallery-section-title {
    color: #c62828;
}

.ia-gallery-grid--trash {
    min-height: 80px;
}

.ia-gallery-grid--trash-empty {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px dashed #f0c0c0;
    border-radius: 6px;
    background: #fff8f8;
}

.ia-gallery-box--drag::after {
    content: 'Drop images here';
    position: absolute;
    inset: 0;
    background: rgba(236, 236, 236, 0.94);
    border: 3px dashed #424041;
    border-radius: 4px;
    display: grid;
    place-items: center;
    font-size: 1rem;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #424041;
    z-index: 10;
    pointer-events: none;
}

/* ── Grid ─────────────────────────────────────────────────────── */

.ia-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 6px;
}

@media (max-width: 575.98px) {
    .ia-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* ── Thumbnail ────────────────────────────────────────────────── */

.ia-gallery-item {
    position: relative;
    aspect-ratio: 1 / 1;
    border-radius: 2px;
    background: #d8d8d8;
    cursor: default;
}

@media (min-width: 768px) {
    .ia-gallery-item         { z-index: 1; }
    .ia-gallery-item.ia-menu-open { z-index: 100; }
}

.ia-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    pointer-events: none;
    user-select: none;
}

/* ── Three-dot menu ───────────────────────────────────────────── */

.ia-gallery-menu-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 24px;
    height: 24px;
    border: none;
    border-radius: 4px;
    background: rgba(0, 0, 0, 0.6);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.15s, background 0.15s;
    z-index: 2;
    padding: 0;
}

.ia-gallery-menu-btn::before {
    content: '';
    display: block;
    width: 3px;
    height: 3px;
    border-radius: 50%;
    background: currentColor;
    box-shadow: 0 -5px 0 currentColor, 0 5px 0 currentColor;
}

.ia-gallery-item:hover .ia-gallery-menu-btn,
.ia-gallery-item.ia-menu-open .ia-gallery-menu-btn {
    opacity: 1;
}

.ia-gallery-menu-btn:hover {
    background: rgba(0, 0, 0, 0.82);
}

.ia-gallery-menu {
    position: absolute;
    top: 32px;
    right: 4px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 3px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    z-index: 10;
    min-width: 88px;
    overflow: hidden;
}

.ia-gallery-menu[hidden] { display: none; }

.ia-gallery-menu button {
    display: block;
    width: 100%;
    padding: 7px 12px;
    text-align: left;
    background: none;
    border: none;
    font-size: 0.8rem;
    cursor: pointer;
    color: #333;
    transition: background 0.1s;
}

.ia-gallery-menu button:hover {
    background: #f5f5f5;
}

.ia-gallery-trash {
    color: #c62828 !important;
}

.ia-gallery-item.ia-menu-open::after {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid rgb(223, 39, 45);
    border-radius: 2px;
    pointer-events: none;
    z-index: 3;
}

.ia-gallery-menu-header {
    display: none;
}

.ia-gallery-cancel {
    display: none;
}

/* ── Mobile sheet ─────────────────────────────────────────────── */

.ia-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.3);
    z-index: 999;
}

@keyframes ia-sheet-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (max-width: 767.98px) {
    .ia-gallery-menu-btn {
        display: none;
    }

    .ia-gallery-menu {
        position: fixed;
        left: 0;
        right: 0;
        bottom: 0;
        top: auto;
        min-width: 0;
        border-radius: 12px 12px 0 0;
        border: none;
        box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.18);
        z-index: 1000;
        padding-bottom: env(safe-area-inset-bottom, 0);
        animation: ia-sheet-up 0.22s ease-out;
    }

    .ia-gallery-menu::before {
        content: '';
        display: block;
        width: 36px;
        height: 4px;
        background: #ddd;
        border-radius: 2px;
        margin: 10px auto 4px;
    }

    .ia-gallery-menu-header {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 4px 16px 12px;
        border-bottom: 1px solid #f0f0f0;
    }

    .ia-gallery-menu-thumb {
        width: 64px !important;
        height: 64px !important;
        object-fit: contain;
        border-radius: 3px;
        background: #ebebeb;
        flex: 0 0 64px;
    }

    .ia-gallery-menu-label {
        font-size: 0.85rem;
        color: #555;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .ia-gallery-menu button {
        padding: 14px 20px;
        font-size: 1rem;
        border-bottom: 1px solid #f2f2f2;
    }

    .ia-gallery-menu button:last-child {
        border-bottom: none;
    }

    .ia-gallery-trash {
        border-bottom: none;
    }

    .ia-gallery-cancel {
        display: block;
        color: #888;
        border-top: 6px solid #f0f0f0;
    }

    .ia-gallery-item {
        cursor: pointer;
    }
}

.ia-x-icon {
    display: block;
    transform: translateY(-1px);
}


/* Shimmer placeholder during upload */
.ia-gallery-item.ia-loading {
    background: #d0d0d0;
    cursor: default;
}

.ia-gallery-item.ia-loading::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, transparent 25%, rgba(255,255,255,0.45) 50%, transparent 75%);
    background-size: 200% 100%;
    animation: ia-shimmer 1.2s infinite;
}

@keyframes ia-shimmer {
    from { background-position: 200% 0; }
    to   { background-position: -200% 0; }
}

/* ── Drop zone prompt (above the box) ────────────────────────── */

.ia-gallery-dropzone {
    font-size: 0.875rem;
    color: #777;
    margin-bottom: 0.5rem;
    user-select: none;
    text-align: right;
}

@media (max-width: 767.98px) {
    .ia-gallery-dropzone span {
        display: none;
    }
}

.ia-gallery-upload-btn {
    background: #424041;
    color: #fff;
    border: none;
    padding: 7px 18px;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s;
    vertical-align: middle;
    margin-left: 4px;
}

.ia-gallery-upload-btn:hover {
    background: #222;
}

/* ── Edit modal ───────────────────────────────────────────────── */

.ia-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10000;
    padding: 20px;
    box-sizing: border-box;
}

.ia-modal[hidden] { display: none; }

/* ── Image edit panel ────────────────────────────────────────── */

.ia-fp-edit-panel {
    background: #f8f8f8;
    border: 1px solid #d0d0d0;
    border-radius: 4px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
    padding: 0.9rem 1rem 0.75rem;
    display: flex;
    gap: 1rem;
    align-items: stretch;
    width: 100%;
    max-width: 560px;
    max-height: 90vh;
    overflow-y: auto;
    box-sizing: border-box;
}

.ia-fp-edit-thumb-col {
    flex-shrink: 0;
    width: 160px;
    align-self: flex-start;
}

.ia-fp-edit-thumb {
    width: 100%;
    object-fit: contain;
    border-radius: 2px;
    display: block;
}

.ia-fp-edit-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.ia-fp-edit-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 0.75rem;
}

.ia-fp-edit-header h4 {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    color: #333;
}

.ia-fp-edit-close {
    background: none;
    border: 1px solid #ccc;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    font-size: 1.1rem;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #666;
    flex-shrink: 0;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.ia-fp-edit-close:hover {
    background: #e8e8e8;
    border-color: #aaa;
    color: #222;
}

.ia-fp-edit-fields {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.5rem;
}

.ia-fp-edit-fields label {
    display: flex;
    flex-direction: column;
    font-size: 0.8rem;
    font-weight: 500;
    color: #555;
    gap: 3px;
}

.ia-fp-edit-fields input[type="text"],
.ia-fp-edit-fields textarea {
    padding: 5px 8px;
    border: 1px solid #ccc;
    border-radius: 2px;
    font-size: 0.875rem;
    font-family: inherit;
    background: #fff;
}

.ia-fp-edit-fields textarea {
    resize: vertical;
    width: 100%;
    box-sizing: border-box;
}

.ia-fp-field-hint {
    font-size: 0.75rem;
    color: #999;
    line-height: 1.4;
    margin-top: 2px;
}



.ia-fp-edit-footer {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 0.75rem;
}

.ia-fp-edit-save {
    background: #424041;
    color: #fff;
    border: none;
    padding: 6px 14px;
    font-size: 0.85rem;
    cursor: pointer;
    border-radius: 2px;
    transition: background 0.15s;
}

.ia-fp-edit-save:hover:not(:disabled) { background: #222; }

.ia-fp-edit-msg {
    font-size: 0.8rem;
    color: #666;
}

.ia-fp-edit-msg.ia-success { color: #2a7a2a; }

@media (max-width: 575.98px) {
    .ia-fp-edit-panel {
        flex-direction: column;
    }
    .ia-fp-edit-thumb-col {
        width: 100%;
    }
}

/* ── Wizard layout ───────────────────────────────────────────────── */

.ia-account-layout--wizard .ia-account-main {
    width: 100%;
}

@media (min-width: 768px) {
    .ia-account-layout--wizard .ia-account-main {
        padding-left: 0;
        border-left: none;
    }
}

/* ── Wizard progress nav ─────────────────────────────────────────── */

.ia-wizard-nav {
    padding: 2rem 0 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    margin-bottom: 2rem;
}

.ia-wizard-steps {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    justify-content: space-between;
    position: relative;
}

.ia-wizard-steps::before {
    content: '';
    position: absolute;
    top: 17px;
    left: calc(17px + 0.5rem);
    right: calc(17px + 0.5rem);
    height: 2px;
    background: #e0e0e0;
    z-index: 0;
}

.ia-wizard-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    flex: 1;
    position: relative;
    z-index: 1;
}

.ia-wizard-step-circle {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 2px solid #d0d0d0;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.82rem;
    font-weight: 700;
    color: #bbb;
    position: relative;
    z-index: 1;
    transition: border-color 0.2s, background 0.2s, color 0.2s;
    flex-shrink: 0;
}

.ia-wizard-step-circle svg {
    width: 14px;
    height: 14px;
}

.ia-wizard-step--complete .ia-wizard-step-circle {
    background: rgb(223, 39, 45);
    border-color: rgb(223, 39, 45);
    color: #fff;
}

.ia-wizard-step--active .ia-wizard-step-circle {
    border-color: rgb(223, 39, 45);
    color: rgb(223, 39, 45);
    box-shadow: 0 0 0 3px rgba(223, 39, 45, 0.14);
}

.ia-wizard-step-label {
    font-size: 0.68rem;
    font-weight: 500;
    color: #bbb;
    text-align: center;
    line-height: 1.3;
}

.ia-wizard-step--complete .ia-wizard-step-label {
    color: #666;
}

.ia-wizard-step--active .ia-wizard-step-label {
    font-weight: 700;
    color: rgb(223, 39, 45);
}

@media (max-width: 575.98px) {
    .ia-wizard-step-circle {
        width: 28px;
        height: 28px;
        font-size: 0.72rem;
    }

    .ia-wizard-steps::before {
        top: 13px;
    }

    .ia-wizard-step-label {
        display: none;
    }

    .ia-wizard-step--active .ia-wizard-step-label {
        display: block;
    }
}

/* ── Wizard step intro ───────────────────────────────────────────── */

.ia-wizard-step-intro {
    margin-bottom: 2rem;
}

.ia-wizard-step-title {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.ia-wizard-intro-text {
    color: #555;
}

.ia-wizard-intro-text p:last-child {
    margin-bottom: 0;
}

/* ── Wizard form ─────────────────────────────────────────────────── */

.ia-wizard-form {
    max-width: 560px;
}

.ia-wizard-fields {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
}

.ia-field {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.ia-field > span,
.ia-field > legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: #424041;
}

.ia-required {
    color: rgb(223, 39, 45);
}

.ia-field input[type="text"],
.ia-field input[type="email"],
.ia-field input[type="url"],
.ia-field input[type="tel"],
.ia-field input[type="password"],
.ia-field select,
.ia-field textarea {
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 1rem;
    border-radius: 2px;
    background: #fff;
    color: #424041;
    transition: border-color 0.15s;
    font-family: inherit;
}

.ia-field input:focus,
.ia-field select:focus,
.ia-field textarea:focus {
    border-color: rgb(223, 39, 45);
    outline: none;
    box-shadow: 0 0 0 2px rgba(223, 39, 45, 0.15);
}

/* ── Address group ───────────────────────────────────────────────── */

.ia-address-group {
    border: none;
    margin: 0;
    padding: 0;
}

.ia-address-group legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: #424041;
    margin-bottom: 0.75rem;
    padding: 0;
    float: left;
    width: 100%;
}

.ia-address-group .ia-field {
    margin-bottom: 0.75rem;
}

.ia-address-inline {
    display: flex;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ia-address-inline .ia-field {
    flex: 1;
    min-width: 0;
    margin-bottom: 0;
}

.ia-field--short {
    flex: 0 0 90px !important;
}

/* ── Social media repeater ───────────────────────────────────────── */

.ia-social-repeater {
    border: none;
    margin: 0;
    padding: 0;
}

.ia-social-repeater legend {
    font-size: 0.875rem;
    font-weight: 600;
    color: #424041;
    margin-bottom: 0.75rem;
    padding: 0;
    float: left;
    width: 100%;
}

#ia-social-rows {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 0.75rem;
}

.ia-social-row {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ia-social-row select {
    flex: 0 0 140px;
    border: 1px solid #ccc;
    padding: 8px 10px;
    font-size: 0.875rem;
    font-family: inherit;
    border-radius: 2px;
    background: #fff;
    color: #424041;
    cursor: pointer;
}

.ia-social-row input[type="url"] {
    flex: 1;
    border: 1px solid #ccc;
    padding: 8px 12px;
    font-size: 0.875rem;
    border-radius: 2px;
    background: #fff;
    color: #424041;
}

.ia-social-row select:focus,
.ia-social-row input:focus {
    border-color: rgb(223, 39, 45);
    outline: none;
    box-shadow: 0 0 0 2px rgba(223, 39, 45, 0.15);
}

.ia-social-remove {
    background: none;
    border: 1px solid #ddd;
    width: 30px;
    height: 30px;
    border-radius: 2px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    line-height: 1;
    color: #aaa;
    flex-shrink: 0;
    padding: 0;
    transition: border-color 0.15s, color 0.15s;
}

.ia-social-remove:hover {
    border-color: rgb(223, 39, 45);
    color: rgb(223, 39, 45);
}

/* ── Buttons ─────────────────────────────────────────────────────── */

.ia-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 9px 22px;
    font-size: 0.875rem;
    font-weight: 600;
    border: 2px solid transparent;
    border-radius: 2px;
    cursor: pointer;
    text-decoration: none !important;
    transition: background 0.15s, color 0.15s, border-color 0.15s, opacity 0.15s;
    line-height: 1.2;
    font-family: inherit;
}

.ia-btn--primary {
    background: rgb(223, 39, 45);
    color: #fff !important;
    border-color: rgb(223, 39, 45);
}

.ia-btn--primary:hover:not(:disabled) {
    background: rgb(195, 28, 34);
    border-color: rgb(195, 28, 34);
}

.ia-btn--primary:disabled {
    opacity: 0.6;
    cursor: default;
}

.ia-btn--back {
    background: transparent;
    color: #555 !important;
    border-color: #ccc;
}

.ia-btn--back:hover {
    border-color: #424041;
    color: #424041 !important;
}

.ia-btn--ghost {
    background: transparent;
    color: #666 !important;
    border-color: #ccc;
}

.ia-btn--ghost:hover:not(:disabled) {
    color: #424041 !important;
    border-color: #424041;
}

.ia-btn--ghost:disabled {
    opacity: 0.5;
    cursor: default;
}

.ia-btn--large {
    padding: 12px 36px;
    font-size: 1rem;
}

.ia-btn--secondary {
    background: #424041;
    color: #fff !important;
    border-color: #424041;
}

.ia-btn--secondary:hover {
    background: #222;
    border-color: #222;
}

/* ── Wizard footer ───────────────────────────────────────────────── */

.ia-wizard-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8e8e8;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ia-wizard-footer-left,
.ia-wizard-footer-right {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-wrap: wrap;
}

.ia-wizard-footer-inner {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    margin-top: 1.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid #e8e8e8;
}

/* ── 6-digit verification inputs ────────────────────────────────── */

.ia-verify-digits {
    display: flex;
    gap: 10px;
    margin: 1.5rem 0 0.75rem;
    justify-content: center;
}

.ia-verify-digit {
    width: 52px;
    height: 60px;
    font-size: 1.85rem;
    font-weight: 700;
    text-align: center;
    border: 2px solid #ccc;
    border-radius: 4px;
    padding: 0;
    color: #424041;
    background: #fff;
    transition: border-color 0.15s, box-shadow 0.15s;
    -moz-appearance: textfield;
    caret-color: rgb(223, 39, 45);
}

.ia-verify-digit::-webkit-inner-spin-button,
.ia-verify-digit::-webkit-outer-spin-button {
    -webkit-appearance: none;
}

.ia-verify-digit:focus {
    outline: none;
    border-color: rgb(223, 39, 45);
    box-shadow: 0 0 0 2px rgba(223, 39, 45, 0.15);
}

.ia-verify-digit.ia-digit-filled {
    border-color: #424041;
}

@keyframes ia-shake {
    0%, 100% { transform: translateX(0); }
    20%       { transform: translateX(-7px); }
    40%       { transform: translateX(7px); }
    60%       { transform: translateX(-4px); }
    80%       { transform: translateX(4px); }
}

.ia-verify-shake {
    animation: ia-shake 0.42s ease;
}

.ia-verify-msg {
    text-align: center;
    font-size: 0.875rem;
    min-height: 1.4em;
    color: #c62828;
    margin-bottom: 0;
}

.ia-verify-resend {
    text-align: center;
    font-size: 0.875rem;
    color: #555;
    margin-top: 1.25rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
}

#ia-resend-btn {
    background: none;
    border: none;
    padding: 0;
    color: rgb(223, 39, 45);
    cursor: pointer;
    font-size: inherit;
    font-family: inherit;
    text-decoration: underline;
}

#ia-resend-btn:disabled {
    color: #aaa;
    cursor: default;
    text-decoration: none;
}

.ia-resend-countdown {
    color: #999;
    font-size: 0.8rem;
}

/* ── Password rules ──────────────────────────────────────────────── */

#ia-password-rules {
    list-style: none;
    margin: 0.5rem 0 0;
    padding: 0;
    font-size: 0.82rem;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px 12px;
}

.ia-rule {
    display: flex;
    align-items: center;
    gap: 5px;
    color: #aaa;
    line-height: 1.5;
    transition: color 0.15s;
}

.ia-rule::before {
    content: '○';
    font-size: 0.8em;
    flex-shrink: 0;
    transition: content 0.1s;
}

.ia-rule--met {
    color: #2a7a2a;
}

.ia-rule--met::before {
    content: '✓';
}

/* ── Eye toggle ──────────────────────────────────────────────────── */

.ia-password-wrap {
    position: relative;
}

.ia-password-wrap input {
    padding-right: 40px !important;
    width: 100%;
    box-sizing: border-box;
}

/* ── Categories checklist ────────────────────────────────────────── */

.ia-categories-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    margin-bottom: 2rem;
}

@media (max-width: 575.98px) {
    .ia-categories-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ia-category-option {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color 0.15s, background 0.15s;
}

.ia-category-option:hover {
    border-color: #aaa;
    background: #fafafa;
}

.ia-category-option:has(input:checked) {
    border-color: rgb(223, 39, 45);
    background: #fff5f5;
}

.ia-category-option input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    accent-color: rgb(223, 39, 45);
}

/* ── Categories field on the account page (acf_form, taxonomy/checkbox
   field) — restyled to match the .ia-categories-grid look above ────── */

.ia-account--portfolio .acf-field[data-name="categories"] .categorychecklist-holder {
    border: none;
    max-height: none;
    overflow: visible;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list::before,
.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list::after {
    /* ACF's own .acf-bl clearfix (content: "") is harmless in its native block
       layout, but as a grid child it becomes a real, invisible grid item and
       eats the first/last cell. Suppress it so the list is grid-only. */
    content: none;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
    padding: 0;
    border: none;
}

@media (max-width: 575.98px) {
    .ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list {
        grid-template-columns: repeat(2, 1fr);
    }
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list li {
    font-size: inherit;
    line-height: normal;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list li label {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 3px;
    cursor: pointer;
    font-size: 0.875rem;
    transition: border-color 0.15s, background 0.15s;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list li label:hover {
    border-color: #aaa;
    background: #fafafa;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list li label:has(input:checked) {
    border-color: rgb(223, 39, 45);
    background: #fff5f5;
}

.ia-account--portfolio .acf-field[data-name="categories"] .acf-checkbox-list input[type="checkbox"] {
    margin: 0;
    flex-shrink: 0;
    accent-color: rgb(223, 39, 45);
}

/* ── Wizard submit step ──────────────────────────────────────────── */

.ia-wizard-submit {
    padding: 2rem 0;
}

.ia-wizard-submit > .ia-btn {
    display: inline-flex;
    margin-bottom: 0.75rem;
}

#ia-submit-msg {
    min-height: 1.4em;
    font-size: 0.9rem;
    margin: 0.5rem 0;
}

.ia-wizard-images-note {
    color: #555;
    font-size: 0.875rem;
    margin-bottom: 1rem;
}

/* ── Submitted notice ────────────────────────────────────────────── */

.ia-account--submitted {
    display: flex;
    justify-content: center;
    padding: 3rem 0;
}

.ia-submitted-notice {
    text-align: center;
    max-width: 480px;
}

.ia-submitted-icon {
    width: 64px;
    height: 64px;
    background: #edf7ed;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.75rem;
    color: #4caf50;
    margin: 0 auto 1.5rem;
}

.ia-submitted-notice h2 {
    margin-bottom: 0.75rem;
}

.ia-submitted-notice p {
    color: #555;
    margin-bottom: 0.75rem;
}

.ia-submitted-notice .ia-btn {
    margin-top: 1rem;
}

/* ── Wizard account container ────────────────────────────────────── */

.ia-account--wizard {
    max-width: 640px;
}

.ia-account--verify {
    max-width: 480px;
    margin-left: auto;
    margin-right: auto;
}

.ia-wizard-logout-link {
    font-size: 0.85rem;
}

/* ── Wizard step inner (clickable completed steps) ───────────────── */

.ia-wizard-step {
    display: flex;
    justify-content: center;
    flex-direction: column;
    align-items: center;
}

.ia-wizard-step-inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    text-decoration: none !important;
    color: inherit;
}

a.ia-wizard-step-inner:hover .ia-wizard-step-circle {
    background: rgb(195, 28, 34);
    border-color: rgb(195, 28, 34);
}

a.ia-wizard-step-inner:hover .ia-wizard-step-label {
    color: #555;
}

/* ── Eye icon button (wraps both SVGs) ───────────────────────────── */

.ia-password-eye {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 4px;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.15s;
    line-height: 1;
}

.ia-password-eye:hover {
    color: #424041;
}

.ia-eye-show,
.ia-eye-hide {
    display: block;
    width: 18px;
    height: 18px;
}

.ia-eye-show.ia-hidden,
.ia-eye-hide.ia-hidden {
    display: none !important;
}

.ia-password-eye[aria-pressed="true"] {
    color: #424041;
}

.ia-eye-show svg,
.ia-eye-hide svg {
    width: 18px;
    height: 18px;
    display: block;
}

/* ── Password rules: single column ──────────────────────────────── */

#ia-password-rules {
    grid-template-columns: 1fr;
    font-size: 0.7rem;
    gap: 2px 8px;
}

/* ── Toast notifications ─────────────────────────────────────────── */

.ia-toast-container {
    position: fixed;
    top: 1.5rem;
    left: 50%;
    transform: translateX(-50%);
    z-index: 99999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    width: calc(100vw - 2rem);
    max-width: 480px;
}

.ia-toast {
    background: #333;
    color: #fff;
    padding: 12px 20px;
    border-radius: 4px;
    font-size: 0.9rem;
    line-height: 1.5;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.22);
    pointer-events: all;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.25s ease, transform 0.25s ease;
}

.ia-toast--visible {
    opacity: 1;
    transform: translateY(0);
}

.ia-toast--success { background: #2a7a2a; }
.ia-toast--error   { background: rgb(190, 30, 36); }
.ia-toast--info    { background: #1565c0; }

/* ── Social drag handle ──────────────────────────────────────────── */

.ia-drag-handle {
    cursor: grab;
    color: #ccc;
    font-size: 1rem;
    flex-shrink: 0;
    padding: 4px 2px;
    user-select: none;
    transition: color 0.15s;
    line-height: 1;
}

.ia-drag-handle:active {
    cursor: grabbing;
}

.ia-social-row:hover .ia-drag-handle {
    color: #888;
}

/* ── Gallery wizard mode ─────────────────────────────────────────── */

.ia-gallery-box--wizard-mode .ia-gallery-section--library,
.ia-gallery-box--wizard-mode .ia-gallery-section--trash {
    display: none;
}

/* ── ACF form submit button in wizard ────────────────────────────── */

.ia-account--wizard .acf-form-submit {
    display: none;
}


/* ── Center wizard column ────────────────────────────────────────── */

.ia-account--wizard {
    margin-left: auto;
    margin-right: auto;
}

/* ── Bio textarea ────────────────────────────────────────────────── */

.ia-bio-textarea {
    width: 100%;
    box-sizing: border-box;
    resize: vertical;
    min-height: 180px;
}

.ia-field--full {
    width: 100%;
}

/* ── Field note (e.g. "use your real name") ──────────────────────── */

.ia-field-note {
    font-size: 0.82rem;
    color: #777;
    margin: 0;
    line-height: 1.5;
}

/* ── Registration form additions ─────────────────────────────────── */

.ia-real-name-note {
    font-size: 0.82rem;
    color: #777;
    margin: 0 0 0.5rem;
    line-height: 1.5;
}

.ia-small-text,
.ia-register-privacy.ia-small-text {
    font-size: 0.78rem !important;
    color: #888 !important;
    margin-top: 0.25rem !important;
}

.ia-terms-field {
    display: flex !important;
    flex-direction: row !important;
    align-items: flex-start !important;
    gap: 0.5rem !important;
    font-size: 0.8rem !important;
    margin-top: 0.75rem !important;
}

.ia-terms-field input[type="checkbox"] {
    width: auto !important;
    flex-shrink: 0;
    margin-top: 3px;
}

.ia-terms-field span {
    display: inline !important;
    font-size: 0.8rem !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    color: #666 !important;
    line-height: 1.5;
    margin-bottom: 0 !important;
}
