:root {
    --bg-dark: #050506;
    --bg-card: #0b0b0d;
    --bg-card-soft: #151518;
    --accent-yellow: #facc15;
    --accent-yellow-soft: #fbbf24;
    --accent-yellow-deep: #f59e0b;
    --text-main: #f9fafb;
    --text-muted: #9ca3af;
}

/* RESET & BASE --------------------------------------------------------- */

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
    width: 100%;
    min-height: 100%;
    font-family: system-ui,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif;
    color: var(--text-main);
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top left, rgba(250,204,21,0.28), transparent 55%),
        radial-gradient(circle at bottom right, rgba(250,204,21,0.22), transparent 52%),
        linear-gradient(135deg, #020203, #050506);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 16px;
}

/* LAYOUT --------------------------------------------------------------- */

.wrapper {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
}

.card-main {
    background:
        radial-gradient(circle at top, rgba(250,204,21,0.12), transparent 55%),
        linear-gradient(145deg, #050506, #020203);
    border-radius: 26px;
    padding: 24px;
    border: 1px solid rgba(250,204,21,0.28);
    box-shadow:
        0 24px 70px rgba(0,0,0,0.95),
        0 0 0 1px rgba(15,15,15,0.6);
    backdrop-filter: blur(18px);
    position: relative;
    overflow: hidden;
}

.card-main::before {
    content: "";
    position: absolute;
    inset: -40%;
    background: radial-gradient(circle at top right, rgba(250,204,21,0.14), transparent 70%);
    opacity: 0.4;
    pointer-events: none;
}

.header {
    position: relative;
    z-index: 1;
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 20px;
}

/* HEADER / LOGO -------------------------------------------------------- */

.logo {
    display: flex;
    align-items: center;
    gap: 14px;
}

.logo-circle {
    width: 42px;
    height: 42px;
    border-radius: 16px;
    background: radial-gradient(circle at 30% 30%, #ffffff, #fde68a, #facc15);
    box-shadow:
        0 0 16px rgba(250,204,21,0.9),
        0 0 28px rgba(250,204,21,0.55);
    display: block;
    object-fit: cover;
}


.logo-text-main {
    font-size: clamp(1.25rem, 2vw, 1.55rem);
    font-weight: 800;
    letter-spacing: 0.04em;
}

.logo-text-sub {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.badge-live {
    height: fit-content;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 7px 13px;
    border-radius: 999px;
    background: rgba(15,15,15,0.9);
    border: 1px solid rgba(250,204,21,0.4);
    font-size: 0.8rem;
    white-space: nowrap;
    backdrop-filter: blur(10px);
    color: #fefce8;
}

.badge-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #bef264;
    box-shadow: 0 0 10px #bef264;
    animation: blink 1s infinite;
}

/* GRID CONTENT --------------------------------------------------------- */

.content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
    gap: 18px;
}

/* CARD / BOX ----------------------------------------------------------- */

.box {
    background:
        radial-gradient(circle at top, rgba(250,204,21,0.1), transparent 60%),
        linear-gradient(145deg, var(--bg-card), #050506);
    border-radius: 20px;
    padding: 18px;
    border: 1px solid rgba(31,41,55,0.9);
    position: relative;
    overflow: hidden;
}

.box::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at bottom right, rgba(250,204,21,0.12), transparent 60%);
    opacity: 0.7;
    pointer-events: none;
}

.box-inner {
    position: relative;
    z-index: 1;
}

.box-title {
    font-size: 0.78rem;
    text-transform: uppercase;
    letter-spacing: 1.7px;
    color: var(--text-muted);
    margin-bottom: 3px;
}

.box-heading {
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: 10px;
}

/* ALIAS / FORM --------------------------------------------------------- */

.alias-display {
    background:
        radial-gradient(circle at left, rgba(250,204,21,0.16), transparent 65%),
        var(--bg-card-soft);
    border-radius: 16px;
    padding: 12px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    border: 1px solid rgba(55,65,81,0.9);
}

.alias-email {
    font-family: "JetBrains Mono","Courier New",monospace;
    font-size: 0.95rem;
    word-break: break-all;
}

.alias-placeholder {
    color: var(--text-muted);
    font-size: 0.9rem;
}

.btn {
    border: none;
    outline: none;
    padding: 9px 16px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition:
        transform .12s ease,
        box-shadow .12s ease,
        background .12s ease,
        opacity .12s ease;
    white-space: nowrap;
}

.btn-primary {
    background: linear-gradient(135deg,var(--accent-yellow),var(--accent-yellow-soft));
    color: #111827;
    box-shadow: 0 0 18px rgba(250,204,21,0.6);
}

.btn-primary:hover {
    transform: translateY(-1px);
    box-shadow: 0 0 26px rgba(250,204,21,0.9);
}

.btn-ghost {
    background: rgba(15,15,15,0.9);
    color: var(--text-muted);
    border: 1px solid rgba(75,85,99,0.9);
}

.btn-ghost:hover {
    color: #fefce8;
    border-color: rgba(250,204,21,0.9);
    background: rgba(10,10,10,0.95);
}

.btn-icon {
    font-size: 0.9rem;
}

.actions {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 13px;
}

.hint {
    margin-top: 10px;
    font-size: 0.8rem;
    color: var(--text-muted);
    line-height: 1.5;
}

.manual-input {
    margin-top: 14px;
}

.manual-input label {
    font-size: 0.8rem;
    color: var(--text-muted);
    display: block;
    margin-bottom: 3px;
}

.input-group {
    display: flex;
    gap: 8px;
    align-items: center;
}

.input-text {
    flex: 1;
    border-radius: 999px;
    border: 1px solid rgba(55,65,81,0.9);
    background: rgba(10,10,10,0.95);
    color: var(--text-main);
    padding: 8px 12px;
    font-size: 0.88rem;
}

.input-text::placeholder {
    color: #6b7280;
}

.error {
    margin-top: 8px;
    font-size: 0.8rem;
    color: #fecaca;
}

/* INBOX --------------------------------------------------------------- */

.inbox-header {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    align-items: center;
    margin-bottom: 8px;
}

.chip {
    font-size: 0.75rem;
    padding: 4px 10px;
    border-radius: 999px;
    background: rgba(10,10,10,0.95);
    border: 1px solid rgba(55,65,81,0.9);
    color: var(--text-muted);
    white-space: nowrap;
}

.chip span.dot {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--accent-yellow-soft);
    margin-right: 5px;
    box-shadow: 0 0 10px rgba(250,204,21,0.9);
}

.emails-list {
    margin-top: 6px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
    scrollbar-width: thin;
}

.emails-list::-webkit-scrollbar {
    width: 6px;
}

.emails-list::-webkit-scrollbar-track {
    background: rgba(17,17,17,0.95);
}

.emails-list::-webkit-scrollbar-thumb {
    background: rgba(82,82,91,0.9);
    border-radius: 999px;
}

.email-item {
    background: linear-gradient(145deg, #151518, #050506);
    border-radius: 14px;
    padding: 10px 12px;
    margin-bottom: 8px;
    border: 1px solid rgba(55,65,81,0.9);
    cursor: pointer;
    transition:
        background .12s ease,
        border-color .12s ease,
        transform .12s ease,
        box-shadow .12s ease;
}

.email-item:hover {
    border-color: rgba(250,204,21,0.95);
    box-shadow: 0 10px 26px rgba(0,0,0,0.75);
    transform: translateY(-1px);
}

.email-header-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    margin-bottom: 3px;
}

.email-subject {
    font-size: 0.92rem;
    font-weight: 600;
}

.email-meta {
    font-size: 0.75rem;
    color: var(--text-muted);
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 4px;
}

.email-preview {
    font-size: 0.8rem;
    color: #e5e7eb;
}

.empty-state {
    margin-top: 20px;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-align: center;
}

/* FOOTER -------------------------------------------------------------- */

footer {
    position: relative;
    z-index: 1;
    margin-top: 18px;
    text-align: center;
    font-size: 0.75rem;
    color: var(--text-muted);
}

footer span {
    color: var(--accent-yellow-soft);
}

/* MODAL --------------------------------------------------------------- */

.modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.7);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 50;
}

.modal-backdrop.active {
    display: flex;
}

.modal {
    background: #050506;
    border-radius: 18px;
    max-width: 900px;
    width: 95%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    border: 1px solid rgba(55,65,81,0.9);
    box-shadow: 0 18px 60px rgba(0,0,0,1);
}

.modal-header {
    padding: 12px 16px;
    border-bottom: 1px solid rgba(55,65,81,0.9);
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.modal-title-wrap {
    min-width: 0;
}

.modal-subject {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 3px;
}

.modal-meta {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.modal-actions {
    display: flex;
    gap: 8px;
}

.modal-body {
    background: #ffffff;
    color: #111827;
    height: 65vh;
    overflow: hidden;
}

.modal-body iframe {
    width: 100%;
    height: 100%;
    border: none;
    background: #ffffff;
}

.modal-footer {
    padding: 10px 16px;
    border-top: 1px solid rgba(55,65,81,0.9);
    text-align: right;
}

/* INFO STRIP / HIGHLIGHT ---------------------------------------------- */

.info-strip {
    margin-top: 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.info-pill {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 10px;
    border-radius: 999px;
    background: rgba(10,10,10,0.95);
    border: 1px solid rgba(55,65,81,0.9);
    font-size: 0.75rem;
    color: var(--text-muted);
}

.info-pill i {
    font-size: 0.8rem;
    color: var(--accent-yellow-soft);
}

/* ANIMATIONS ---------------------------------------------------------- */

@keyframes pulse {
    0% { transform: translateY(0); }
    50% { transform: translateY(-1px) scale(1.03); }
    100% { transform: translateY(0); }
}

@keyframes blink {
    0%,100% { opacity: 1; }
    50% { opacity: 0.25; }
}

/* RESPONSIVE ---------------------------------------------------------- */

@media (max-width: 960px) {
    body {
        padding: 12px;
    }

    .content {
        grid-template-columns: 1fr;
    }

    .card-main {
        padding: 20px;
    }
}

@media (max-width: 768px) {
    .alias-display {
        flex-direction: column;
        align-items: flex-start;
    }

    .actions {
        flex-direction: column;
        align-items: stretch;
    }

    .actions .btn {
        width: 100%;
        justify-content: center;
    }

    .input-group {
        flex-direction: column;
        align-items: stretch;
    }

    .input-group .btn {
        width: 100%;
        justify-content: center;
    }

    .badge-live {
        align-self: flex-start;
    }

    .emails-list {
        max-height: 360px;
    }

    .modal {
        max-height: 92vh;
    }

    .modal-body {
        height: 60vh;
    }
}

@media (max-width: 600px) {
    .card-main {
        padding: 18px;
        border-radius: 22px;
    }

    .logo-text-main {
        font-size: 1.2rem;
    }

    .header {
        align-items: flex-start;
    }

    .badge-live {
        margin-top: 4px;
    }
}
