/* =========================================
   GICELL TEMP MAIL — STYLESHEET
   ========================================= */

*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --bg: #080810;
    --surface: #0f0f1a;
    --surface-2: #161628;
    --border: rgba(255, 255, 255, 0.07);
    --border-h: rgba(255, 255, 255, 0.14);
    --accent: #7c6dfa;
    --accent-2: #a78bfa;
    --accent-g: rgba(124, 109, 250, 0.2);
    --green: #4ade80;
    --text-1: #f0f0f8;
    --text-2: #a0a0b8;
    --text-3: #5c5c78;
    --mono: 'JetBrains Mono', monospace;
    --sans: 'Inter', system-ui, sans-serif;
    --display: 'Space Grotesk', system-ui, sans-serif;
    --ease: cubic-bezier(0.25, 0.46, 0.45, 0.94);
    --nav-h: 64px;
    --radius: 14px;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    font-family: var(--sans);
    background: var(--bg);
    color: var(--text-1);
    line-height: 1.6;
    overflow-x: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

/* Noise */
.noise {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    opacity: 0.025;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-size: 256px 256px;
}

/* NAV */
#navbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-h);
    background: rgba(8, 8, 16, 0.85);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid var(--border);
}

.nav-inner {
    max-width: 800px;
    margin: 0 auto;
    padding: 0 24px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.nav-logo {
    font-family: var(--display);
    font-weight: 700;
    font-size: 1rem;
}

.nav-logo span {
    color: var(--accent);
}

.nav-tag {
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--accent-2);
    background: rgba(124, 109, 250, 0.1);
    border: 1px solid rgba(124, 109, 250, 0.2);
    padding: 4px 10px;
    border-radius: 100px;
}

/* HERO */
#hero {
    position: relative;
    padding: calc(var(--nav-h) + 60px) 24px 60px;
    text-align: center;
    overflow: hidden;
}

.orb {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    pointer-events: none;
}

.orb-1 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(124, 109, 250, 0.15) 0%, transparent 70%);
    top: -120px;
    left: 50%;
    transform: translateX(-60%);
}

.orb-2 {
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(74, 222, 128, 0.08) 0%, transparent 70%);
    bottom: -80px;
    right: -80px;
}

.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green);
    background: rgba(74, 222, 128, 0.08);
    border: 1px solid rgba(74, 222, 128, 0.2);
    padding: 5px 13px;
    border-radius: 100px;
    margin-bottom: 24px;
}

.hero-badge::before {
    content: '';
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--green);
    animation: ping 2s ease-in-out infinite;
}

@keyframes ping {

    0%,
    100% {
        opacity: 1;
        transform: scale(1)
    }

    50% {
        opacity: .5;
        transform: scale(.8)
    }
}

.hero-title {
    font-family: var(--display);
    font-size: clamp(2.2rem, 6vw, 4rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.1;
    margin-bottom: 16px;
}

.hero-title .accent {
    background: linear-gradient(135deg, var(--accent), var(--accent-2));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-sub {
    font-size: 1rem;
    color: var(--text-2);
    line-height: 1.7;
    max-width: 460px;
    margin: 0 auto;
}

.hero-sub strong {
    color: var(--text-1);
    font-weight: 600;
}

/* MAIN APP */
#app {
    position: relative;
    z-index: 1;
    max-width: 720px;
    margin: 0 auto;
    padding: 0 20px 80px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

/* CARD */
.card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 28px;
}

.card-label {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--text-3);
    margin-bottom: 16px;
}

/* EMAIL CARD */
.email-display {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 14px 16px;
    margin-bottom: 14px;
}

.email-text {
    font-family: var(--mono);
    font-size: 1rem;
    font-weight: 500;
    color: var(--accent-2);
    word-break: break-all;
    flex: 1;
}

.email-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.icon-btn {
    width: 34px;
    height: 34px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: var(--text-2);
    transition: all .2s var(--ease);
}

.icon-btn svg {
    width: 15px;
    height: 15px;
}

.icon-btn:hover {
    color: var(--text-1);
    border-color: var(--border-h);
    background: rgba(255, 255, 255, 0.1);
}

.icon-btn.success {
    color: var(--green);
    border-color: rgba(74, 222, 128, .3);
}

.email-meta {
    display: flex;
    gap: 20px;
    margin-bottom: 18px;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 0.8rem;
    color: var(--text-3);
}

.meta-item svg {
    width: 14px;
    height: 14px;
}

/* TTL */
.ttl-row {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.ttl-label {
    font-size: 0.8rem;
    color: var(--text-3);
    white-space: nowrap;
}

.ttl-options {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
}

.ttl-btn {
    font-family: var(--sans);
    font-size: 0.78rem;
    font-weight: 500;
    padding: 5px 12px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    color: var(--text-2);
    cursor: pointer;
    transition: all .2s var(--ease);
}

.ttl-btn.active,
.ttl-btn:hover {
    background: var(--accent);
    border-color: var(--accent);
    color: #fff;
}

/* INBOX */
.inbox-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 16px;
}

.inbox-header .card-label {
    margin-bottom: 0;
}

.refresh-inbox-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    font-family: var(--sans);
    font-size: 0.8rem;
    font-weight: 500;
    padding: 6px 14px;
    background: rgba(124, 109, 250, 0.1);
    border: 1px solid rgba(124, 109, 250, 0.2);
    border-radius: 8px;
    color: var(--accent-2);
    cursor: pointer;
    transition: all .2s;
}

.refresh-inbox-btn svg {
    width: 13px;
    height: 13px;
}

.refresh-inbox-btn:hover {
    background: rgba(124, 109, 250, 0.2);
}

.refresh-inbox-btn.spinning svg {
    animation: spin .7s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Empty */
.inbox-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 20px;
    gap: 10px;
    text-align: center;
}

.inbox-empty-icon {
    width: 54px;
    height: 54px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-3);
    margin-bottom: 8px;
}

.inbox-empty-icon svg {
    width: 24px;
    height: 24px;
}

.inbox-empty p {
    font-weight: 500;
    color: var(--text-2);
}

.inbox-empty span {
    font-size: 0.83rem;
    color: var(--text-3);
}

/* Messages */
.inbox-messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.msg-item {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    padding: 14px 16px;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 10px;
    cursor: pointer;
    transition: border-color .2s, transform .2s var(--ease);
}

.msg-item:hover {
    border-color: var(--border-h);
    transform: translateX(3px);
}

.msg-icon {
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    background: rgba(124, 109, 250, 0.1);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--accent);
}

.msg-icon svg {
    width: 16px;
    height: 16px;
}

.msg-body {
    flex: 1;
    min-width: 0;
}

.msg-from {
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--text-1);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.msg-subject {
    font-size: 0.82rem;
    color: var(--text-2);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.msg-code-badge {
    font-size: 0.72rem;
    font-weight: 700;
    font-family: var(--mono);
    background: rgba(74, 222, 128, 0.12);
    color: var(--green);
    border: 1px solid rgba(74, 222, 128, .2);
    padding: 2px 8px;
    border-radius: 4px;
    margin-top: 4px;
    display: inline-block;
}

/* has-code highlight */
.msg-item.has-code {
    border-color: rgba(74, 222, 128, .2);
}

/* MODAL */
.modal-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(10px);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.modal-overlay.open {
    display: flex;
}

.modal {
    background: var(--surface);
    border: 1px solid var(--border-h);
    border-radius: var(--radius);
    padding: 32px;
    max-width: 600px;
    width: 100%;
    max-height: 80vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn .25s var(--ease);
}

@keyframes modalIn {
    from {
        opacity: 0;
        transform: scale(.96) translateY(10px);
    }

    to {
        opacity: 1;
        transform: none;
    }
}

.modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 30px;
    height: 30px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid var(--border);
    border-radius: 6px;
    cursor: pointer;
    color: var(--text-2);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all .2s;
}

.modal-close svg {
    width: 14px;
    height: 14px;
}

.modal-close:hover {
    color: var(--text-1);
}

.modal-meta {
    display: flex;
    gap: 12px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.modal-from {
    font-size: 0.82rem;
    color: var(--text-2);
}

.modal-date {
    font-size: 0.82rem;
    color: var(--text-3);
}

.modal-subject {
    font-family: var(--display);
    font-size: 1.1rem;
    font-weight: 600;
    color: var(--text-1);
    margin-bottom: 16px;
}

.modal-divider {
    height: 1px;
    background: var(--border);
    margin-bottom: 16px;
}

.modal-body {
    font-family: var(--mono);
    font-size: 0.83rem;
    color: var(--text-2);
    white-space: pre-wrap;
    word-break: break-word;
    line-height: 1.7;
    max-height: 320px;
    overflow-y: auto;
}

.modal-code {
    margin-top: 20px;
    padding: 12px 16px;
    background: rgba(74, 222, 128, 0.06);
    border: 1px solid rgba(74, 222, 128, .2);
    border-radius: 10px;
    display: flex;
    align-items: center;
    gap: 12px;
}

.modal-code-label {
    font-size: 0.75rem;
    color: var(--green);
    text-transform: uppercase;
    letter-spacing: .06em;
}

.modal-code-value {
    font-family: var(--mono);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--green);
    flex: 1;
    letter-spacing: 0.15em;
}

/* TOAST */
.toast {
    position: fixed;
    bottom: 28px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--surface-2);
    border: 1px solid var(--border-h);
    border-radius: 8px;
    padding: 10px 20px;
    font-size: 0.85rem;
    color: var(--text-1);
    opacity: 0;
    transition: all .3s var(--ease);
    white-space: nowrap;
    z-index: 300;
    pointer-events: none;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* FOOTER */
#footer {
    border-top: 1px solid var(--border);
    padding: 24px;
    text-align: center;
}

.footer-inner {
    display: flex;
    gap: 24px;
    justify-content: center;
    flex-wrap: wrap;
    font-size: 0.8rem;
    color: var(--text-3);
}

.footer-inner a {
    color: var(--accent-2);
}

/* RESPONSIVE */
@media (max-width: 520px) {
    .email-text {
        font-size: 0.85rem;
    }

    .card {
        padding: 20px;
    }

    .hero-sub br {
        display: none;
    }

    .ttl-btn {
        font-size: 0.73rem;
        padding: 5px 10px;
    }
}