﻿

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    --navy: #0a0f1c;
    --navy-mid: #10182b;
    --card-bg: rgba(15, 21, 38, 0.78);
    --border: rgba(255, 255, 255, 0.08);
    --border-soft: rgba(255, 255, 255, 0.05);
    --muted: #64748b;
    --text: #e7eaf0;
    --text-dim: #93a0b4;
    --error-h: #f43f5e;
    --error-s: rgba(244, 63, 94, 0.13);
    --warn-h: #f59e0b;
    --warn-s: rgba(245, 158, 11, 0.13);
    --ok-h: #10d992;
    --ok-s: rgba(16, 217, 146, 0.13);
    --info-h: #3b82f6;
    --info-s: rgba(59, 130, 246, 0.13);
    --accent-1: #2563eb;
    --accent-2: #7c3aed;
    --btn-r: 9px;
    --card-r: 18px;
    --trans: .18s cubic-bezier(.4,0,.2,1);
}

html, body {
    min-height: 100dvh;
    font-family: 'Cairo','Tajawal', sans-serif;
    font-size: 15px;
    line-height: 1.55;
    direction: rtl;
    color: var(--text);
    background: var(--navy);
    overflow-x: hidden;
}

    /* ── Ambient background ──────────────────────────────────── */
    body::before {
        content: "";
        position: fixed;
        inset: 0;
        background: radial-gradient(ellipse 70% 50% at 50% -8%, rgba(59,130,246,.20) 0%, transparent 62%), radial-gradient(ellipse 55% 40% at 92% 108%, rgba(124,58,237,.16) 0%, transparent 58%), radial-gradient(ellipse 40% 30% at 4% 100%, rgba(16,185,129,.07) 0%, transparent 60%);
        pointer-events: none;
        z-index: 0;
    }

    body::after {
        content: "";
        position: fixed;
        inset: 0;
        background-image: linear-gradient(rgba(255,255,255,.022) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.022) 1px, transparent 1px);
        background-size: 36px 36px;
        pointer-events: none;
        z-index: 0;
    }

/* ── Layout wrapper ──────────────────────────────────────── */
.ep-shell {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 100dvh;
    padding: 14px;
}

/* ── Card ────────────────────────────────────────────────── */
.ep-card {
    width: 100%;
    max-width: 410px;
    background: var(--card-bg);
    border: 1px solid var(--border);
    border-radius: var(--card-r);
    backdrop-filter: blur(22px) saturate(1.5);
    -webkit-backdrop-filter: blur(22px) saturate(1.5);
    padding: 22px 22px 16px;
    box-shadow: 0 0 0 1px rgba(255,255,255,.04) inset, 0 24px 64px rgba(0,0,0,.55), 0 6px 18px rgba(0,0,0,.35);
    animation: cardIn .38s cubic-bezier(.34,1.3,.64,1) both;
}

@keyframes cardIn {
    from {
        opacity: 0;
        transform: translateY(18px) scale(.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* ── Top brand strip ─────────────────────────────────────── */
.ep-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 14px;
    padding-bottom: 10px;
    border-bottom: 1px solid var(--border-soft);
}

.ep-brand-name {
    font-family: 'Cairo', sans-serif;
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .07em;
    text-transform: uppercase;
    color: var(--text-dim);
}

.ep-brand-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--error-h);
    box-shadow: 0 0 0 3px rgba(244,63,94,.22);
    animation: blink 2.2s ease-in-out infinite;
}

    .ep-brand-dot.warn {
        background: var(--warn-h);
        box-shadow: 0 0 0 3px rgba(245,158,11,.22);
    }

    .ep-brand-dot.ok {
        background: var(--ok-h);
        box-shadow: 0 0 0 3px rgba(16,217,146,.22);
    }

    .ep-brand-dot.info {
        background: var(--info-h);
        box-shadow: 0 0 0 3px rgba(59,130,246,.22);
    }

@keyframes blink {
    0%, 100% {
        opacity: 1;
    }

    50% {
        opacity: .35;
    }
}

/* ── Icon block ──────────────────────────────────────────── */
.ep-icon-wrap {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 52px;
    height: 52px;
    border-radius: 15px;
    margin: 0 auto 12px;
    font-size: 1.6rem;
    position: relative;
}

    .ep-icon-wrap.error {
        background: var(--error-s);
        color: var(--error-h);
        border: 1px solid rgba(244,63,94,.22);
    }

    .ep-icon-wrap.warning {
        background: var(--warn-s);
        color: var(--warn-h);
        border: 1px solid rgba(245,158,11,.22);
    }

    .ep-icon-wrap.success {
        background: var(--ok-s);
        color: var(--ok-h);
        border: 1px solid rgba(16,217,146,.22);
    }

    .ep-icon-wrap.info {
        background: var(--info-s);
        color: var(--info-h);
        border: 1px solid rgba(59,130,246,.22);
    }

    /* Signature element — a single quiet pulse ring around the icon */
    .ep-icon-wrap::after {
        content: "";
        position: absolute;
        inset: -6px;
        border-radius: 20px;
        border: 1.5px solid currentColor;
        opacity: 0;
        animation: iconPulse 2.6s ease-out infinite;
    }

@keyframes iconPulse {
    0% {
        opacity: .5;
        transform: scale(.92);
    }

    80% {
        opacity: 0;
        transform: scale(1.2);
    }

    100% {
        opacity: 0;
        transform: scale(1.2);
    }
}

/* ── Title ───────────────────────────────────────────────── */
.ep-title {
    font-family: 'Cairo', sans-serif;
    font-size: 1.12rem;
    font-weight: 800;
    text-align: center;
    color: #f8fafc;
    margin-bottom: 5px;
    line-height: 1.3;
}

/* ── Message ─────────────────────────────────────────────── */
.ep-message {
    font-size: .85rem;
    color: var(--text-dim);
    text-align: center;
    line-height: 1.6;
    margin-bottom: 14px;
}

/* ── DB badge ────────────────────────────────────────────── */
.ep-db-badge {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,.04);
    border: 1px solid var(--border-soft);
    border-radius: 9px;
    padding: 7px 12px;
    margin-bottom: 12px;
    font-size: .78rem;
}

    .ep-db-badge .label {
        color: var(--text-dim);
        white-space: nowrap;
    }

    .ep-db-badge .value {
        font-family: 'Cairo', monospace;
        font-weight: 700;
        color: #f8fafc;
        word-break: break-all;
    }

/* ── Suggestions ─────────────────────────────────────────── */
.ep-suggestions {
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: 11px;
    padding: 10px 12px;
    margin-bottom: 14px;
}

    .ep-suggestions h6 {
        font-size: .76rem;
        font-weight: 700;
        color: var(--text-dim);
        margin-bottom: 6px;
        display: flex;
        align-items: center;
        gap: 5px;
    }

    .ep-suggestions ul {
        padding-right: 16px;
        margin: 0;
    }

        .ep-suggestions ul li {
            font-size: .78rem;
            color: var(--text-dim);
            margin-bottom: 3px;
            line-height: 1.5;
        }

            .ep-suggestions ul li:last-child {
                margin-bottom: 0;
            }

/* ── Buttons ─────────────────────────────────────────────── */
.ep-actions {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    justify-content: center;
    margin-bottom: 12px;
}

.ep-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 8px 18px;
    border-radius: var(--btn-r);
    font-family: 'Cairo', sans-serif;
    font-size: .82rem;
    font-weight: 700;
    border: none;
    cursor: pointer;
    transition: all var(--trans);
    white-space: nowrap;
    text-decoration: none;
    min-height: 36px;
}

    .ep-btn:focus-visible {
        outline: 3px solid rgba(59,130,246,.5);
        outline-offset: 2px;
    }

/* Primary — gradient */
.ep-btn-primary {
    background: linear-gradient(135deg, var(--accent-1) 0%, #1d4ed8 100%);
    color: #fff;
    box-shadow: 0 2px 8px rgba(37,99,235,.4);
    flex: 1 1 auto;
    min-width: 140px;
}

    .ep-btn-primary:hover {
        background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
        box-shadow: 0 4px 16px rgba(37,99,235,.5);
        transform: translateY(-1px);
        color: #fff;
    }

    .ep-btn-primary:active {
        transform: translateY(0);
    }

/* Ghost */
.ep-btn-ghost {
    background: rgba(255,255,255,.05);
    color: var(--text-dim);
    border: 1px solid var(--border);
}

    .ep-btn-ghost:hover {
        background: rgba(255,255,255,.09);
        color: var(--text);
        border-color: rgba(255,255,255,.16);
    }

/* ── Error code chip ─────────────────────────────────────── */
.ep-code {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: .72rem;
    color: var(--muted);
    background: rgba(255,255,255,.03);
    border: 1px solid var(--border-soft);
    border-radius: 6px;
    padding: 3px 9px;
    font-family: monospace;
    letter-spacing: .03em;
}

.ep-footer {
    display: flex;
    justify-content: center;
    margin-top: 2px;
}

/* ── Responsive ──────────────────────────────────────────── */
@media (max-width: 480px) {
    .ep-card {
        padding: 18px 16px 14px;
        border-radius: 15px;
    }

    .ep-title {
        font-size: 1.02rem;
    }

    .ep-icon-wrap {
        width: 46px;
        height: 46px;
        font-size: 1.4rem;
    }

    .ep-actions {
        flex-direction: column;
    }

    .ep-btn {
        width: 100%;
        min-width: 0;
    }
}

@media (max-width: 360px) {
    .ep-card {
        padding: 16px 13px 12px;
    }

    .ep-title {
        font-size: .96rem;
    }

    .ep-message {
        font-size: .8rem;
    }
}

/* ── Reduced motion ──────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
    .ep-card, .ep-icon-wrap::after, .ep-brand-dot {
        animation: none;
    }

    .ep-btn {
        transition: none;
    }
}
