/* fig-byte mail — premium dark glass theme (vanilla CSS, no frameworks) */
:root {
  --void-bg: #050308;
  --plum-deep: #14081F;
  --plum-neon: #C77DFF;
  --plum-violet: #7B2CBF;
  --plum-glow: rgba(199, 125, 255, 0.15);
  --glass-bg: rgba(255, 255, 255, 0.03);
  --glass-border: rgba(255, 255, 255, 0.09);
  --text-primary: #F5F0F8;
  --text-muted: #8a7d96;
  --input-bg: rgba(0, 0, 0, 0.35);
  --danger: #ff7b8a;
  --ok-green: #7be3a8;
}
* { box-sizing: border-box; }
body {
  margin: 0; background: var(--void-bg); color: var(--text-primary);
  font-family: 'Inter', system-ui, sans-serif; min-height: 100vh;
}
.bg-layer { position: fixed; inset: 0; z-index: -3; background: var(--void-bg); }
.grid-bg {
  position: fixed; inset: 0; z-index: -2; pointer-events: none;
  background-image: linear-gradient(rgba(199,125,255,0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(199,125,255,0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(circle at 50% 0%, black 0%, transparent 85%);
}
.spotlight {
  position: fixed; inset: 0; z-index: -1; pointer-events: none;
  background: radial-gradient(circle 560px at 50% -80px, var(--plum-glow), transparent 70%);
}
h1, h2, h3, .brand-text { font-family: 'Sora', sans-serif; letter-spacing: -0.02em; }
a { color: var(--plum-neon); text-decoration: none; }
a:hover { text-decoration: underline; }

/* top bar */
.topbar {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 22px; position: sticky; top: 0; z-index: 50;
  background: rgba(5, 3, 8, 0.75); backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--glass-border);
}
.brand { display: flex; align-items: center; gap: 12px; }
.brand img.logo { height: 34px; width: auto; display: block; }
.mail-icon { width: 22px; height: 22px; color: var(--plum-neon); }
.top-right { display: flex; align-items: center; gap: 10px; }
.bw-pill {
  font-size: 0.8rem; color: var(--text-muted); border: 1px solid var(--glass-border);
  border-radius: 100px; padding: 5px 14px; white-space: nowrap;
}
.menu-btn { position: static; transform: none; display: none; }
.menu-btn:hover { transform: none; }
.menu-btn svg { width: 22px; height: 22px; }
.menu-panel { margin-bottom: 14px; }
.menu-panel p { margin: 8px 0; }
.bottombar { color: var(--text-muted); font-size: 0.82rem; margin: 26px 0 10px; }

.wrap { max-width: 1020px; margin: 26px auto 60px; padding: 0 16px; }

/* cards & forms */
.card {
  background: var(--glass-bg); backdrop-filter: blur(24px) saturate(160%);
  border: 1px solid var(--glass-border); border-radius: 20px;
  padding: 22px; box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}
label { display: block; margin: 12px 0; color: var(--text-muted); font-size: 0.9rem; }
input[type=text], input[type=password], textarea {
  width: 100%; margin-top: 6px; padding: 11px 13px; font-size: 1em;
  background: var(--input-bg); border: 1px solid var(--glass-border);
  border-radius: 12px; color: var(--text-primary); font-family: inherit;
}
input:focus, textarea:focus { outline: none; border-color: var(--plum-neon); box-shadow: 0 0 0 3px var(--plum-glow); }
button, .btn {
  background: linear-gradient(135deg, var(--plum-neon), var(--plum-violet));
  color: #fff; border: 0; border-radius: 100px; padding: 10px 26px;
  font-size: 0.95em; font-weight: 600; font-family: 'Sora', sans-serif;
  cursor: pointer; text-decoration: none; display: inline-block;
  box-shadow: 0 4px 15px var(--plum-glow); transition: transform 0.2s, box-shadow 0.2s;
}
button:hover, .btn:hover { transform: translateY(-2px); box-shadow: 0 8px 25px var(--plum-glow); text-decoration: none; color: #fff; }
.btn-ghost { background: transparent; border: 1px solid var(--glass-border); box-shadow: none; color: var(--text-primary); }
.btn-ghost:hover { border-color: var(--plum-neon); color: var(--plum-neon); box-shadow: none; transform: none; }
.err { background: rgba(255,80,100,0.1); border: 1px solid rgba(255,123,138,0.4); color: #ffb3bd; padding: 10px 14px; border-radius: 12px; }
.ok { background: rgba(80,220,150,0.08); border: 1px solid rgba(123,227,168,0.35); color: var(--ok-green); padding: 10px 14px; border-radius: 12px; }

/* login */
.login-wrap { max-width: 420px; margin: 9vh auto 0; text-align: center; }
.login-wrap .mono { width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 2px solid rgba(199,125,255,0.5); box-shadow: 0 0 30px var(--plum-glow); }
.login-wrap h1 { margin: 16px 0 4px; font-size: 1.7rem; }
.login-wrap p.sub { color: var(--text-muted); margin: 0 0 18px; font-size: 0.95rem; }
.login-wrap form { text-align: left; }

/* folder nav */
.nav { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: 4px 0 14px; }
.nav a, .nav strong {
  padding: 7px 16px; border-radius: 100px; font-size: 0.87rem;
  border: 1px solid transparent; color: var(--text-muted);
}
.nav a:hover { color: var(--plum-neon); border-color: var(--glass-border); text-decoration: none; }
.nav strong { color: #fff; background: linear-gradient(135deg, rgba(199,125,255,0.25), rgba(123,44,191,0.25)); border-color: rgba(199,125,255,0.4); }
.nav a.btn, .nav a.btn:hover { color: #fff; }
.nav .right { margin-left: auto; }
.meta { color: var(--text-muted); font-size: 0.85rem; margin: 0 0 12px; }

/* mail list */
table.mail { width: 100%; border-collapse: separate; border-spacing: 0 8px; }
table.mail th { text-align: left; font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); padding: 0 12px 2px; font-weight: 500; }
table.mail td { padding: 13px 12px; background: var(--glass-bg); border-top: 1px solid var(--glass-border); border-bottom: 1px solid var(--glass-border); font-size: 0.93rem; }
table.mail td:first-child { border-left: 1px solid var(--glass-border); border-radius: 12px 0 0 12px; color: var(--text-muted); max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
table.mail td:last-child { border-right: 1px solid var(--glass-border); border-radius: 0 12px 12px 0; color: var(--text-muted); white-space: nowrap; font-size: 0.82rem; }
table.mail tr.unseen td { background: rgba(199,125,255,0.07); }
table.mail tr.unseen td:nth-child(2) a { font-weight: 700; color: #fff; }
table.mail td:nth-child(2) a { color: var(--text-primary); }
table.mail tr:hover td { border-color: rgba(199,125,255,0.35); }
.empty { text-align: center; color: var(--text-muted); padding: 50px 0; }

/* reading pane */
.msg-head { margin-bottom: 6px; }
.msg-head p { margin: 5px 0; font-size: 0.93rem; }
.msg-head .lbl { color: var(--text-muted); display: inline-block; width: 70px; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; }
pre.body { white-space: pre-wrap; word-wrap: break-word; font-family: inherit; font-size: 0.95rem; line-height: 1.65; }
.mailframe { width: 100%; min-height: 60vh; border: 1px solid var(--glass-border); border-radius: 12px; background: transparent; }
.fmt-toggle { margin: 4px 0 10px; font-size: 0.85rem; }
.msg-actions { margin-top: 16px; display: flex; gap: 10px; align-items: center; }
.back { display: inline-block; margin: 2px 0 12px; font-size: 0.9rem; }

.footer-note { display: none; }

/* search */
.searchbar { display: flex; gap: 8px; margin: 0 0 14px; }
.searchbar input[type=text] { flex: 1; margin: 0; }
.searchbar select {
  background: var(--input-bg); border: 1px solid var(--glass-border); border-radius: 12px;
  color: var(--text-primary); padding: 0 10px; font-family: inherit;
}

/* compose formatter */
.fmt-row { display: flex; gap: 16px; margin: 12px 0 0; }
.toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 8px 0; }
.toolbar button {
  background: transparent; border: 1px solid var(--glass-border); box-shadow: none;
  color: var(--text-primary); border-radius: 8px; padding: 6px 12px; font-size: 0.85em;
}
.toolbar button:hover { border-color: var(--plum-neon); color: var(--plum-neon); transform: none; box-shadow: none; }
.editor {
  min-height: 220px; padding: 11px 13px; font-size: 1em;
  background: var(--input-bg); border: 1px solid var(--glass-border); border-radius: 12px;
}
.editor:focus { outline: none; border-color: var(--plum-neon); }
input[type=file] { color: var(--text-muted); font-size: 0.9em; }

/* attachments */
.attach-list { margin: 12px 0 4px; }
.attach-list ul { margin: 8px 0; padding-left: 20px; }
.attach-list li { margin: 4px 0; }

/* login autocomplete */
.suggest { display: none; position: relative; }
.suggest-item {
  padding: 9px 13px; font-size: 0.9rem; cursor: pointer;
  background: rgba(20, 8, 31, 0.97); border: 1px solid var(--glass-border);
  border-top: 0; color: var(--text-primary);
}
.suggest-item:first-child { border-top: 1px solid var(--glass-border); border-radius: 8px 8px 0 0; margin-top: 4px; }
.suggest-item:last-child { border-radius: 0 0 8px 8px; }
.suggest-item:hover { border-color: rgba(199,125,255,0.4); color: var(--plum-neon); }

/* password toggle + remember */
.pw-wrap { position: relative; display: block; }
.pw-wrap input { width: 100%; padding-right: 42px; }
.icon-btn {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  background: none; border: 0; box-shadow: none; padding: 6px; cursor: pointer; color: var(--text-muted);
}
.icon-btn:hover { transform: translateY(-50%); box-shadow: none; color: var(--plum-neon); }
.icon-btn svg { width: 20px; height: 20px; display: block; }
label.remember { display: flex; align-items: center; gap: 8px; font-size: 0.88rem; cursor: pointer; }
label.remember input { width: auto; margin: 0; accent-color: var(--plum-neon); }

@media (max-width: 640px) {
  .bw-pill { display: none; }
  .menu-btn { display: block; }
  table.mail th:nth-child(3), table.mail td:nth-child(3) { display: none; }
  table.mail td:first-child { max-width: 110px; }
  .wrap { margin-top: 16px; }
}
