/* =========================
   iOS 26 LIQUID GLASS UI (FIXED)
========================= */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", system-ui;
}

body {
    background: radial-gradient(circle at top, #0b1220, #05070c);
    color: #eaf0ff;
    overflow: hidden;
}

/* ===== GLASS BASE (manual copy everywhere) ===== */
.glass {
    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow:
        0 10px 40px rgba(0,0,0,0.45),
        inset 0 1px 0 rgba(255,255,255,0.05);
    border-radius: 18px;
}

/* ===== LOGIN ===== */
#login {
    position: fixed;
    inset: 0;
    display: flex;
    justify-content: center;
    align-items: center;
    background: radial-gradient(circle at center, #101a30, #05070c);
}

.loginBox {
    width: 360px;
    padding: 26px;

    background: rgba(25, 30, 50, 0.6);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border-radius: 22px;

    animation: pop .25s ease;
}

/* ===== INPUTS ===== */
input, textarea {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(10, 15, 25, 0.6);
    color: white;
    outline: none;
    transition: .2s;
}

input:focus, textarea:focus {
    border-color: rgba(120,180,255,0.6);
    box-shadow: 0 0 0 3px rgba(80,150,255,0.15);
}

/* ===== BUTTONS ===== */
button {
    padding: 10px 14px;
    border-radius: 14px;
    border: none;
    cursor: pointer;
    background: linear-gradient(135deg, #4ea1ff, #2b6fff);
    color: white;
    font-weight: 600;
    transition: .2s;
}

button:hover {
    transform: translateY(-1px);
    box-shadow: 0 10px 25px rgba(70,140,255,0.25);
}

/* ===== APP ===== */
#app {
    display: none;
    height: 100vh;
    padding: 14px;
    gap: 14px;
}

/* ===== SIDEBAR ===== */
.sidebar {
    width: 260px;
    padding: 14px;

    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border-radius: 18px;

    display: flex;
    flex-direction: column;
    gap: 10px;
}

.sidebar h2 {
    font-size: 18px;
    opacity: 0.9;
}

/* ===== MAIN ===== */
.main {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

/* ===== TOPBAR ===== */
.topbar {
    padding: 10px;

    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border-radius: 18px;

    display: flex;
    gap: 10px;
}

/* ===== CONTENT ===== */
.content {
    flex: 1;
    display: flex;
    gap: 14px;
}

/* ===== MAIL LIST ===== */
.list {
    width: 360px;
    overflow: auto;
    padding: 8px;

    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border-radius: 18px;

    scroll-behavior: smooth;
}

/* ===== MAIL ITEM ===== */
.mailItem {
    padding: 12px;
    margin-bottom: 8px;
    border-radius: 14px;
    background: rgba(255,255,255,0.03);
    cursor: pointer;
    transition: .2s;
    position: relative;
}

.mailItem:hover {
    transform: translateX(6px) scale(1.02);
    background: rgba(120,180,255,0.1);
}

/* unread dot */
.unread::before {
    content: "";
    width: 8px;
    height: 8px;
    background: #4ea1ff;
    border-radius: 50%;
    position: absolute;
    left: 10px;
    top: 18px;
    box-shadow: 0 0 10px #4ea1ff;
}

/* ===== PREVIEW ===== */
.preview {
    flex: 1;
    padding: 18px;

    background: rgba(20, 25, 40, 0.55);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.08);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);
    border-radius: 18px;

    animation: fade .2s ease;
}

/* ===== COMPOSE ===== */
#compose {
    position: fixed;
    right: 20px;
    bottom: 20px;
    width: 420px;
    padding: 14px;
    display: none;
    flex-direction: column;
    gap: 10px;

    background: rgba(20, 25, 40, 0.65);
    backdrop-filter: blur(22px);
    -webkit-backdrop-filter: blur(22px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 20px 60px rgba(0,0,0,0.6);
    border-radius: 18px;

    animation: pop .2s ease;
}

/* ===== TOAST ===== */
#toast {
    position: fixed;
    bottom: 20px;
    left: 20px;
    padding: 12px 16px;
    border-radius: 14px;

    background: rgba(20, 25, 40, 0.65);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border: 1px solid rgba(255,255,255,0.1);
    box-shadow: 0 10px 40px rgba(0,0,0,0.45);

    display: none;
    animation: fade .2s ease;
}

/* ===== ANIMATIONS ===== */
@keyframes pop {
    from { transform: scale(0.96); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

@keyframes fade {
    from { opacity: 0; transform: translateY(4px); }
    to { opacity: 1; transform: translateY(0); }
}

/* ===== BACKGROUND GLOW ===== */
body::before {
    content: "";
    position: absolute;
    width: 700px;
    height: 700px;
    background:
        radial-gradient(circle, rgba(78,161,255,0.18), transparent 60%),
        radial-gradient(circle at bottom right, rgba(140,80,255,0.12), transparent 60%);
    top: -250px;
    left: -250px;
    filter: blur(60px);
}