/* ============================================================
   CE Account Modal
   ============================================================ */

.ce-acct-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .45);
    z-index: 100001;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .18s ease;
}

.ce-acct-overlay.ce-acct-modal--visible {
    opacity: 1;
}

.ce-acct-box {
    background: var(--ce-acct-bg, #fff);
    color: var(--ce-acct-text, #1d2327);
    border-radius: 12px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, .18);
    width: 400px;
    max-width: 95vw;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    font-family: inherit;
    transform: translateY(12px);
    transition: transform .18s ease;
}

.ce-acct-overlay.ce-acct-modal--visible .ce-acct-box {
    transform: translateY(0);
}

/* ── Header ───────────────────────────────────────────────── */

.ce-acct-header {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 20px 20px 16px;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    position: relative;
}

.ce-acct-header__icon {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(var(--ce-acct-accent-rgb, 34, 113, 177), .1);
    color: var(--ce-acct-accent, #2271b1);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.ce-acct-header__info {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0;
    flex: 1;
}

.ce-acct-username {
    font-size: 15px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ce-acct-email {
    font-size: 13px;
    opacity: .6;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.ce-acct-loading-text {
    animation: ce-acct-pulse 1.2s ease-in-out infinite;
}

@keyframes ce-acct-pulse {
    0%, 100% { opacity: .3; }
    50%       { opacity: .6; }
}

.ce-acct-wp-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--ce-acct-accent, #2271b1);
    font-weight: 500;
}

.ce-acct-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit;
    opacity: .5;
    padding: 4px;
    line-height: 0;
    border-radius: 6px;
    transition: opacity .15s, background .15s;
}

.ce-acct-close:hover {
    opacity: 1;
    background: rgba(0, 0, 0, .06);
}

/* ── Body ─────────────────────────────────────────────────── */

.ce-acct-body {
    padding: 8px 0 16px;
}

/* ── Sections ─────────────────────────────────────────────── */

.ce-acct-section {
    padding: 12px 20px;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
}

.ce-acct-section:last-child {
    border-bottom: none;
}

.ce-acct-section__title {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .04em;
    opacity: .5;
    margin-bottom: 10px;
}

/* ── Notification toggle ──────────────────────────────────── */

.ce-acct-toggle {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.4;
}

.ce-acct-toggle input[type="checkbox"] {
    margin-top: 2px;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    accent-color: var(--ce-acct-accent, #2271b1);
    cursor: pointer;
}

.ce-acct-notify-msg {
    font-size: 12px;
    color: var(--ce-acct-accent, #2271b1);
    margin-top: 6px;
    padding: 4px 0;
}

/* ── Profile section label gap ───────────────────────────── */

.ce-acct-panel[data-panel="account"] .ce-acct-section > .ce-acct-label,
.ce-acct-panel[data-panel="account"] .ce-acct-section > .ce-acct-profile-grid {
    margin-top: 10px;
}

.ce-acct-panel[data-panel="account"] .ce-acct-section > .ce-acct-label:first-of-type {
    margin-top: 0;
}

/* ── Password form ────────────────────────────────────────── */

.ce-acct-pw-toggle {
    background: none;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: inherit;
    transition: background .15s, border-color .15s;
}

.ce-acct-pw-toggle:hover {
    background: rgba(0, 0, 0, .04);
    border-color: rgba(0, 0, 0, .25);
}

.ce-acct-pw-form {
    margin-top: 12px;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-acct-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-size: 13px;
    font-weight: 500;
}

.ce-acct-label small {
    font-weight: 400;
    opacity: .6;
    font-size: 11px;
}

.ce-acct-input {
    width: 100%;
    box-sizing: border-box;
    padding: 8px 10px;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    font-size: 14px;
    background: var(--ce-acct-bg, #fff);
    color: inherit;
    outline: none;
    transition: border-color .15s;
}

.ce-acct-input:focus {
    border-color: var(--ce-acct-accent, #2271b1);
    box-shadow: 0 0 0 2px rgba(34, 113, 177, .12);
}

.ce-acct-pw-save {
    align-self: flex-start;
    background: var(--ce-acct-accent, #2271b1);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
}

.ce-acct-pw-save:hover   { opacity: .88; }
.ce-acct-pw-save:disabled { opacity: .5; cursor: not-allowed; }

/* ── Actions row ──────────────────────────────────────────── */

.ce-acct-section--actions {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding-top: 14px;
    padding-bottom: 4px;
}

.ce-acct-logout {
    background: none;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: inherit;
    transition: background .15s;
}

.ce-acct-logout:hover { background: rgba(0, 0, 0, .04); }

.ce-acct-delete-trigger {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    background: none;
    border: none;
    padding: 7px 0;
    font-size: 13px;
    cursor: pointer;
    color: #dc2626;
    opacity: .7;
    transition: opacity .15s;
}

.ce-acct-delete-trigger:hover { opacity: 1; }

/* ── Delete confirmation ──────────────────────────────────── */

.ce-acct-delete-confirm {
    padding: 12px 20px;
    border-top: 1px solid rgba(220, 38, 38, .2);
    background: rgba(220, 38, 38, .04);
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.ce-acct-delete-warn {
    font-size: 13px;
    color: #dc2626;
    margin: 0;
    line-height: 1.4;
}

.ce-acct-delete-yes {
    background: #dc2626;
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 16px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
}

.ce-acct-delete-yes:hover   { opacity: .88; }
.ce-acct-delete-yes:disabled { opacity: .5; cursor: not-allowed; }

.ce-acct-delete-no {
    background: none;
    border: 1px solid rgba(0, 0, 0, .15);
    border-radius: 6px;
    padding: 7px 14px;
    font-size: 13px;
    cursor: pointer;
    color: inherit;
    transition: background .15s;
}

.ce-acct-delete-no:hover { background: rgba(0, 0, 0, .04); }

/* ── Error / Success messages ─────────────────────────────── */

.ce-acct-error {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #fde8e8;
    color: #b32d2e;
    border: 1px solid #f5c2c7;
}

.ce-acct-success {
    font-size: 13px;
    padding: 8px 12px;
    border-radius: 6px;
    background: #d4edda;
    color: #155724;
    border: 1px solid #c3e6cb;
}

/* ── Tabs ─────────────────────────────────────────────────── */

.ce-acct-tabs {
    display: flex;
    border-bottom: 1px solid rgba(0, 0, 0, .08);
    padding: 0 8px;
    gap: 2px;
}

.ce-acct-tab {
    background: none;
    border: none;
    border-bottom: 2px solid transparent;
    padding: 10px 12px 9px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    color: inherit;
    opacity: .5;
    transition: opacity .15s, border-color .15s, color .15s;
    white-space: nowrap;
    margin-bottom: -1px;
    font-family: inherit;
}

.ce-acct-tab:hover {
    opacity: .8;
}

.ce-acct-tab--active {
    opacity: 1;
    border-bottom-color: var(--ce-acct-accent, #2271b1);
    color: var(--ce-acct-accent, #2271b1);
}

/* ── Profile grid ─────────────────────────────────────────── */

.ce-acct-profile-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 0;
}

.ce-acct-textarea {
    resize: vertical;
    min-height: 72px;
    font-family: inherit;
    line-height: 1.4;
}

.ce-acct-profile-save-row {
    display: flex;
    justify-content: flex-end;
    margin-top: 14px;
}

.ce-acct-profile-save {
    background: var(--ce-acct-accent, #2271b1);
    color: #fff;
    border: none;
    border-radius: 6px;
    padding: 8px 18px;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: opacity .15s;
    font-family: inherit;
}

.ce-acct-profile-save:hover    { opacity: .88; }
.ce-acct-profile-save:disabled { opacity: .5; cursor: not-allowed; }

/* ── Notification toggle spacing ─────────────────────────── */

.ce-acct-toggle--spaced {
    margin-top: 10px;
}

/* ── Comments list ────────────────────────────────────────── */

.ce-acct-comments-loading,
.ce-acct-comments-empty {
    font-size: 13px;
    opacity: .55;
    padding: 16px 0;
    text-align: center;
}

.ce-acct-comment-item {
    padding: 10px 0;
    border-bottom: 1px solid rgba(0, 0, 0, .06);
    transition: opacity .3s;
}

.ce-acct-comment-item:last-child {
    border-bottom: none;
}

.ce-acct-comment-item--removing {
    opacity: 0;
}

.ce-acct-comment-content {
    font-size: 13px;
    line-height: 1.45;
    margin-bottom: 6px;
    word-break: break-word;
}

.ce-acct-comment-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.ce-acct-comment-date {
    font-size: 12px;
    opacity: .5;
}

.ce-acct-comment-link {
    font-size: 12px;
    color: var(--ce-acct-accent, #2271b1);
    text-decoration: none;
}

.ce-acct-comment-link:hover {
    text-decoration: underline;
}

.ce-acct-reply-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 22px;
    height: 22px;
    padding: 0 6px;
    border-radius: 11px;
    background: var(--ce-acct-accent, #2271b1);
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    text-decoration: none;
    transition: opacity .15s;
    line-height: 1;
}

.ce-acct-reply-badge:hover { opacity: .8; }

.ce-acct-comment-delete {
    margin-left: auto;
    background: none;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #dc2626;
    opacity: .45;
    transition: opacity .15s;
    line-height: 0;
    flex-shrink: 0;
}

.ce-acct-comment-delete:hover    { opacity: 1; }
.ce-acct-comment-delete:disabled { opacity: .2; cursor: not-allowed; }

/* ── WP-user note ─────────────────────────────────────────── */

.ce-acct-section--wp-note p {
    font-size: 14px;
    line-height: 1.5;
    opacity: .75;
    margin: 0;
}

/* ── Dark-mode aware (via CSS vars from :root) ────────────── */

@media (prefers-color-scheme: dark) {
    .ce-acct-input {
        background: rgba(255, 255, 255, .06);
        border-color: rgba(255, 255, 255, .15);
    }
    .ce-acct-error {
        background: rgba(239, 68, 68, .15);
        color: #fca5a5;
        border-color: rgba(239, 68, 68, .35);
    }
    .ce-acct-success {
        background: rgba(34, 197, 94, .15);
        color: #86efac;
        border-color: rgba(34, 197, 94, .35);
    }
}
