/* ============================================================
   CE Auth Modal – Login / Register
   ============================================================ */

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

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

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

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

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

.ce-auth-tabs {
    display: flex;
    border-bottom: 1px solid var(--ce-border, #e0e0e0);
    border-radius: var(--ce-auth-radius, 12px) var(--ce-auth-radius, 12px) 0 0;
    overflow: hidden;
}

.ce-auth-tab {
    flex: 1;
    padding: 14px 0;
    background: var(--ce-card-bg, #f7f7f7);
    border: none;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: var(--ce-muted-text, #666);
    transition: background .15s, color .15s;
}

.ce-auth-tab.is-active {
    background: var(--ce-auth-bg, #fff);
    color: var(--ce-auth-text, #1d2327);
    border-bottom: 2px solid var(--ce-auth-accent, #2271b1);
    margin-bottom: -1px;
}

.ce-auth-tab:hover:not(.is-active) {
    background: var(--ce-tab-hover-bg, #efefef);
}

/* ── Panel ────────────────────────────────────────────────── */

.ce-auth-panel {
    display: flex;
    flex-direction: column;
}

/* The login panel and the register form (step 1) get internal padding */
.ce-auth-panel[data-panel="login"],
.ce-auth-reg-form {
    padding: 20px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ── Labels + Inputs ──────────────────────────────────────── */

.ce-auth-label {
    display: flex;
    flex-direction: column;
    gap: 5px;
    font-size: 13px;
    color: var(--ce-auth-text, #444);
}

.ce-auth-label small {
    font-weight: 400;
    color: var(--ce-subtle-text, #888);
}

.ce-auth-input {
    padding: 9px 12px;
    border: 1px solid var(--ce-border, #ccc);
    border-radius: 7px;
    font-size: 14px;
    font-family: inherit;
    outline: none;
    transition: border-color .15s;
    width: 100%;
    box-sizing: border-box;
    background: var(--ce-input-bg, transparent);
    color: var(--ce-auth-text, inherit);
}

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

/* ── Submit Button ────────────────────────────────────────── */

.ce-auth-submit {
    margin-top: 4px;
    padding: 10px 0;
    width: 100%;
    background: var(--ce-auth-submit-bg, var(--ce-auth-accent, #2271b1));
    color: var(--ce-auth-submit-text, #fff);
    border: none;
    border-radius: var(--ce-auth-submit-radius, 8px);
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s;
}

.ce-auth-submit:hover {
    background: var(--ce-auth-accent-hover, var(--ce-auth-submit-bg, var(--ce-auth-accent, #1a5e9e)));
    filter: brightness(0.92);
}

.ce-auth-submit:disabled {
    opacity: .65;
    cursor: not-allowed;
}

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

.ce-auth-error {
    background: var(--ce-error-bg, #fde8e8);
    color: var(--ce-error-text, #b32d2e);
    border: 1px solid var(--ce-error-border, #f5c2c7);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

.ce-auth-success {
    background: var(--ce-success-bg, #d4edda);
    color: var(--ce-success-text, #155724);
    border: 1px solid var(--ce-success-border, #c3e6cb);
    border-radius: 6px;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.5;
}

/* ── Close button ─────────────────────────────────────────── */

.ce-auth-close {
    position: absolute;
    top: 10px;
    right: 12px;
    background: none;
    border: none;
    font-size: 22px;
    line-height: 1;
    color: var(--ce-subtle-text, #999);
    cursor: pointer;
    padding: 2px 6px;
}

.ce-auth-close:hover {
    color: var(--ce-auth-text, #333);
}

/* ── Info bar (success hint above login) ─────────────────── */

.ce-auth-info {
    background: var(--ce-success-bg, #d4edda);
    color: var(--ce-success-text, #155724);
    border: 1px solid var(--ce-success-border, #c3e6cb);
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 13px;
}

/* ── Verification-pending step ────────────────────────────── */

.ce-auth-verify-pending {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 20px 24px 24px;
}

.ce-auth-verify-icon {
    font-size: 40px;
    text-align: center;
}

.ce-auth-verify-msg {
    text-align: center;
    font-size: 13px;
    color: var(--ce-muted-text, #444);
    line-height: 1.6;
    margin: 0;
}

.ce-auth-verify-msg small {
    color: var(--ce-subtle-text, #888);
}

.ce-auth-btn-ghost {
    background: none;
    border: 1px solid var(--ce-border, #ccc);
    border-radius: 8px;
    padding: 8px 0;
    font-size: 12px;
    color: var(--ce-muted-text, #666);
    cursor: pointer;
    transition: border-color .15s, color .15s;
    text-align: center;
}

.ce-auth-btn-ghost:hover {
    border-color: var(--ce-muted-text, #999);
    color: var(--ce-auth-text, #333);
}

.ce-auth-btn-ghost:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.ce-auth-resend-msg {
    text-align: center;
    font-size: 12px;
    color: var(--ce-success-text, #155724);
    background: var(--ce-success-bg, #d4edda);
    border-radius: 5px;
    padding: 6px 10px;
}

/* ── User info bar in comment dialog ─────────────────────── */

.ce-comment-user-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--ce-muted-text, #555);
    flex-shrink: 0;
}

.ce-comment-user-bar__name {
    font-weight: 600;
    color: var(--ce-auth-text, #1d2327);
}

.ce-comment-user-bar__logout {
    background: none;
    border: none;
    padding: 0;
    font-size: 11px;
    color: var(--ce-subtle-text, #999);
    cursor: pointer;
    text-decoration: underline;
}

.ce-comment-user-bar__logout:hover {
    color: var(--ce-muted-text, #555);
}

.ce-comment-auth-link {
    background: none;
    border: 1px solid var(--ce-accent, #2271b1);
    color: var(--ce-accent, #2271b1);
    border-radius: 6px;
    padding: 5px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background .15s, color .15s;
    white-space: nowrap;
}

.ce-comment-auth-link:hover {
    background: var(--ce-accent, #2271b1);
    color: #fff;
}
