/* ============================================================
   Temp Mail — dark theme (satu bahasa desain dengan DAPA & Raw Host)
   ============================================================ */

:root {
  --bg:          #070a12;
  --surface:     rgba(255, 255, 255, .035);
  --surface-2:   rgba(255, 255, 255, .06);
  --line:        rgba(255, 255, 255, .085);
  --line-strong: rgba(255, 255, 255, .16);

  --text:        #e8edf7;
  --text-dim:    #99a4bb;
  --text-faint:  #6b7590;

  --accent:      #6d7cff;
  --accent-2:    #22d3ee;
  --accent-soft: rgba(109, 124, 255, .16);

  --good:   #34d399;
  --warn:   #fbbf24;
  --bad:    #fb7185;
  --violet: #a78bfa;

  --radius:    18px;
  --radius-sm: 12px;
  --shadow:    0 24px 60px -28px rgba(0, 0, 0, .95);

  --ease: cubic-bezier(.22, 1, .36, 1);
  --mono: ui-monospace, SFMono-Regular, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;
  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--sans);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

h1, h2, h3 { margin: 0; line-height: 1.2; letter-spacing: -.02em; font-weight: 650; }
p { margin: 0; }
code { font-family: var(--mono); font-size: .88em; }
button, input, textarea, select { font: inherit; color: inherit; }

.wrap { width: min(1080px, 100% - 2.5rem); margin-inline: auto; }

/* ---------- Aurora ---------- */
.aurora { position: fixed; inset: 0; z-index: -1; overflow: hidden; }
.aurora::after {
  content: ""; position: absolute; inset: 0;
  background:
    radial-gradient(1200px 600px at 50% -10%, rgba(109, 124, 255, .10), transparent 70%),
    linear-gradient(180deg, #080c16 0%, #070a12 45%, #05070e 100%);
}
.aurora span {
  position: absolute; border-radius: 50%; filter: blur(90px); opacity: .5;
  animation: drift 26s var(--ease) infinite alternate;
}
.aurora span:nth-child(1) { width: 44vw; height: 44vw; top: -14vw; left: -8vw;  background: #3b3fd6; }
.aurora span:nth-child(2) { width: 38vw; height: 38vw; top: 4vw;  right: -10vw; background: #0e7490; animation-delay: -9s; }
.aurora span:nth-child(3) { width: 32vw; height: 32vw; top: 52vw; left: 28vw;   background: #6d28d9; opacity: .3; animation-delay: -17s; }
@keyframes drift {
  from { transform: translate3d(0, 0, 0) scale(1); }
  to   { transform: translate3d(4vw, 5vw, 0) scale(1.15); }
}

/* ---------- Hero ---------- */
.hero { padding: 3.4rem 0 2rem; max-width: 700px; }
.hero h1 { font-size: clamp(1.9rem, 4.6vw, 2.9rem); font-weight: 700; }
.hero h1 .accent {
  background: linear-gradient(120deg, var(--accent), var(--accent-2));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p { margin-top: .85rem; color: var(--text-dim); font-size: 1.02rem; }

.link-btn {
  display: inline-flex; align-items: center; gap: .4rem; margin-top: 1rem;
  padding: 0; border: 0; background: none; cursor: pointer;
  color: var(--text-faint); font-size: .84rem; text-decoration: none;
  border-bottom: 1px dashed var(--line-strong); transition: color .2s, border-color .2s;
}
.link-btn svg { width: 15px; height: 15px; }
.link-btn:hover { color: var(--accent-2); border-color: var(--accent-2); }

/* ---------- Card ---------- */
.card {
  border: 1px solid var(--line); border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, .05), rgba(255, 255, 255, .02));
  box-shadow: var(--shadow);
}

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: .45rem;
  padding: .72rem 1.2rem; border: 1px solid transparent; border-radius: 13px;
  font-weight: 600; font-size: .88rem; white-space: nowrap; cursor: pointer; text-decoration: none;
  transition: transform .15s var(--ease), background .2s, border-color .2s, opacity .2s;
}
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn svg { width: 16px; height: 16px; }

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #8b5cf6 55%, var(--accent-2));
  background-size: 180% 180%;
  box-shadow: 0 12px 30px -14px rgba(109, 124, 255, 1);
  animation: sheen 7s linear infinite;
}
@keyframes sheen { 50% { background-position: 100% 50%; } }
.btn-primary:hover:not(:disabled) { filter: brightness(1.08); }

.btn-ghost { background: var(--surface); border-color: var(--line); color: var(--text-dim); }
.btn-ghost:hover:not(:disabled) { background: var(--surface-2); color: var(--text); border-color: var(--line-strong); }

.danger-ghost:hover:not(:disabled) { color: #fda4af; border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .1); }

.btn-sm { padding: .5rem .85rem; font-size: .82rem; border-radius: 10px; }
.btn-icon { padding: .72rem .8rem; }

.spinner {
  display: none; width: 15px; height: 15px; flex: none;
  border: 2px solid rgba(255, 255, 255, .3); border-top-color: #fff;
  border-radius: 50%; animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.btn.is-busy .spinner { display: block; }
.btn.is-busy { pointer-events: none; opacity: .8; }
.btn.is-busy svg:not(.spinner) { display: none; }

/* ---------- Kartu alamat ---------- */
.addr-card { padding: 1.25rem; }

.addr-top { display: flex; align-items: center; gap: .7rem; margin-bottom: .7rem; }
.addr-label { font-size: .72rem; letter-spacing: .09em; text-transform: uppercase; color: var(--text-faint); font-weight: 650; }

.pill {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .2rem .6rem; border-radius: 999px;
  font-size: .72rem; font-weight: 550; color: var(--text-dim);
  border: 1px solid var(--line); background: var(--surface);
}
.pill-live { color: var(--accent-2); border-color: rgba(34, 211, 238, .25); background: rgba(34, 211, 238, .08); }
.dot-live {
  width: 6px; height: 6px; border-radius: 50%; background: var(--accent-2);
  box-shadow: 0 0 0 0 rgba(34, 211, 238, .6); animation: pulse 1.8s infinite;
}
@keyframes pulse {
  70%  { box-shadow: 0 0 0 7px rgba(34, 211, 238, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 211, 238, 0); }
}

.addr-row { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; }
.addr {
  flex: 1; min-width: 240px;
  padding: .85rem 1rem; border-radius: 13px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .32);
  font-family: var(--mono); font-size: clamp(.95rem, 2.4vw, 1.2rem); font-weight: 600;
  color: var(--accent-2); word-break: break-all; letter-spacing: -.01em;
}
.addr.is-flash { animation: flash .7s var(--ease); }
@keyframes flash {
  from { border-color: rgba(34, 211, 238, .7); background: rgba(34, 211, 238, .1); }
}
.addr-acts { display: flex; gap: .5rem; flex-wrap: wrap; }

.custom-row {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin-top: .85rem; padding-top: .85rem; border-top: 1px solid var(--line);
  animation: rise .3s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(-6px); } }
.custom-row .at { color: var(--text-faint); font-family: var(--mono); }

.field { position: relative; min-width: 0; }
.field input {
  width: 100%; padding: .55rem .8rem; border-radius: 10px;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .3); color: var(--text);
  font-family: var(--mono); font-size: .86rem; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.field input::placeholder { color: var(--text-faint); font-family: var(--sans); }
.field input:focus { border-color: rgba(109, 124, 255, .6); box-shadow: 0 0 0 3px var(--accent-soft); }
.field-sm { flex: 1 1 180px; }

.ctl { display: inline-flex; align-items: center; gap: .5rem; font-size: .84rem; color: var(--text-dim); }
.ctl select {
  padding: .55rem .6rem; border-radius: 10px; min-width: 170px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(0, 0, 0, .3); outline: none;
  font-family: var(--mono); font-size: .84rem;
  transition: border-color .2s, box-shadow .2s;
}
.ctl select option { background: #0d121e; color: var(--text); }
.ctl select:focus { border-color: rgba(109, 124, 255, .6); box-shadow: 0 0 0 3px var(--accent-soft); }

.addr-foot {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem 1rem;
  margin-top: .9rem; font-size: .8rem;
}
.note-pill { display: inline-flex; align-items: flex-start; gap: .5rem; color: var(--text-faint); font-size: .8rem; }
.note-pill svg { width: 15px; height: 15px; flex: none; margin-top: .18rem; color: var(--good); }
.since { margin-left: auto; color: var(--text-faint); font-family: var(--mono); font-size: .76rem; }

/* ---------- Switch ---------- */
.switch { display: inline-flex; align-items: center; gap: .5rem; cursor: pointer; user-select: none; font-size: .82rem; color: var(--text-dim); }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch .track {
  position: relative; width: 34px; height: 19px; flex: none; border-radius: 999px;
  background: rgba(255, 255, 255, .12); transition: background .22s;
}
.switch .track::after {
  content: ""; position: absolute; top: 2.5px; left: 2.5px;
  width: 14px; height: 14px; border-radius: 50%; background: #fff;
  transition: transform .24s var(--ease);
}
.switch input:checked + .track { background: linear-gradient(120deg, var(--accent), var(--accent-2)); }
.switch input:checked + .track::after { transform: translateX(15px); }
.switch input:focus-visible + .track { box-shadow: 0 0 0 3px var(--accent-soft); }

/* ---------- Inbox ---------- */
.table-card { margin-top: 1.6rem; overflow: hidden; }
.table-toolbar {
  display: flex; flex-wrap: wrap; align-items: center; gap: .6rem .8rem;
  padding: .85rem 1rem; border-bottom: 1px solid var(--line);
}
.toolbar-title { font-size: .95rem; font-weight: 650; }
.toolbar-spacer { flex: 1 1 auto; }
.shown-count { font-size: .76rem; color: var(--text-faint); font-family: var(--mono); }
.counter {
  font-size: .76rem; font-family: var(--mono); color: var(--accent-2);
  background: rgba(34, 211, 238, .1); border: 1px solid rgba(34, 211, 238, .2);
  padding: .18rem .55rem; border-radius: 999px;
}

.items { display: flex; flex-direction: column; gap: .6rem; padding: 1rem; max-height: 70vh; overflow-y: auto; overscroll-behavior: contain; }

.item {
  position: relative; overflow: hidden;
  border: 1px solid var(--line); border-radius: 14px;
  background: rgba(0, 0, 0, .24); padding: .85rem 1rem;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.item::before {
  content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 2px;
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  opacity: 0; transition: opacity .2s;
}
.item:hover { border-color: var(--line-strong); background: rgba(255, 255, 255, .035); transform: translateY(-1px); }
.item:hover::before { opacity: .9; }
.item.is-new { animation: pop .4s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } }
.item.is-going { opacity: .35; pointer-events: none; }

.item-head { display: flex; align-items: flex-start; gap: .8rem; }
.item-main { flex: 1; min-width: 0; }

.avatar {
  flex: none; width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(109, 124, 255, .22), rgba(34, 211, 238, .16));
  border: 1px solid rgba(109, 124, 255, .28);
  color: #b9c2ff; font-weight: 700; font-size: .85rem;
}

.mail-top { display: flex; align-items: baseline; gap: .6rem; }
.mail-from { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--mono); font-size: .8rem; color: var(--text-dim); }
.mail-when { flex: none; font-size: .73rem; color: var(--text-faint); font-family: var(--mono); }
.mail-subject { margin-top: .15rem; font-weight: 600; font-size: .95rem; word-break: break-word; }
.mail-subject em { color: var(--text-faint); font-weight: 500; }
.mail-preview {
  margin-top: .2rem; font-size: .82rem; color: var(--text-faint); line-height: 1.45;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.item-acts { display: flex; gap: .4rem; flex: none; }
.row-btn {
  width: 30px; height: 30px; display: grid; place-items: center; padding: 0;
  border: 1px solid var(--line); border-radius: 9px;
  background: var(--surface); color: var(--text-dim); cursor: pointer; transition: .18s;
}
.row-btn:hover { color: var(--text); border-color: var(--line-strong); background: var(--surface-2); }
.row-btn svg { width: 15px; height: 15px; }
.row-btn.danger:hover { color: #fda4af; border-color: rgba(251, 113, 133, .35); background: rgba(251, 113, 133, .12); }

.empty-state { display: flex; flex-direction: column; align-items: center; gap: .3rem; padding: 4rem 1.5rem; color: var(--text-faint); text-align: center; }
.empty-state svg { width: 46px; height: 46px; opacity: .4; margin-bottom: .5rem; }
.empty-state p { font-size: .95rem; color: var(--text-dim); }
.empty-state small { font-size: .8rem; }

/* ---------- Modal ---------- */
.modal { position: fixed; inset: 0; z-index: 90; display: grid; place-items: center; padding: 1.25rem; }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(3, 5, 10, .72); backdrop-filter: blur(6px); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }
.modal-box {
  position: relative; width: min(880px, 100%); max-height: 90dvh; overflow-y: auto;
  padding: 1.4rem; border-radius: var(--radius);
  border: 1px solid var(--line-strong); background: #0a0e18;
  box-shadow: 0 40px 90px -30px rgba(0, 0, 0, 1);
  animation: popin .3s var(--ease);
}
.modal-narrow { width: min(600px, 100%); }
@keyframes popin { from { opacity: 0; transform: translateY(16px) scale(.98); } }
.modal-close {
  position: absolute; top: .8rem; right: .8rem; width: 32px; height: 32px;
  border: 1px solid var(--line); border-radius: 9px; background: var(--surface);
  color: var(--text-dim); font-size: 1.3rem; line-height: 1; cursor: pointer; transition: .18s;
}
.modal-close:hover { background: var(--surface-2); color: var(--text); }
.modal-box h2 { font-size: 1.15rem; padding-right: 2.5rem; word-break: break-word; }

.mail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; margin-top: .35rem; font-size: .8rem; color: var(--text-faint); font-family: var(--mono); }
.mail-meta .dot { opacity: .5; }

.mail-bar {
  display: flex; align-items: center; gap: .5rem; flex-wrap: wrap;
  margin: 1rem 0 .75rem; padding-top: .9rem; border-top: 1px solid var(--line);
}

.mail-frame-wrap {
  border: 1px solid var(--line); border-radius: var(--radius-sm);
  background: #0e131f; overflow: hidden;
}
.mail-frame { display: block; width: 100%; height: 55vh; min-height: 280px; border: 0; background: #0e131f; }

.help-list { margin: 1rem 0 0; font-size: .88rem; }
.help-list dt { font-weight: 650; color: var(--accent-2); margin-top: .85rem; }
.help-list dt:first-child { margin-top: 0; }
.help-list dd { margin: .2rem 0 0; color: var(--text-dim); }

/* ---------- Toasts ---------- */
.toasts { position: fixed; bottom: 1.25rem; right: 1.25rem; z-index: 120; display: flex; flex-direction: column; gap: .55rem; pointer-events: none; }
.toast {
  padding: .7rem 1rem; border-radius: var(--radius-sm); font-size: .85rem;
  border: 1px solid var(--line-strong); background: #10151f; color: var(--text);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .95);
  animation: toastIn .3s var(--ease); max-width: 340px;
}
.toast.ok  { border-color: rgba(52, 211, 153, .35); }
.toast.err { border-color: rgba(251, 113, 133, .35); }
.toast.out { animation: toastOut .25s forwards; }
@keyframes toastIn  { from { opacity: 0; transform: translateX(18px); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(18px); } }

/* ---------- Footer ---------- */
.site-foot { padding: 2.5rem 0 3rem; color: var(--text-faint); font-size: .8rem; max-width: 860px; }

/* ---------- Responsive ---------- */
@media (max-width: 720px) {
  .wrap { width: min(1080px, 100% - 1.6rem); }
  .hero { padding: 2.2rem 0 1.5rem; }
  .addr { min-width: 100%; }
  .addr-acts { width: 100%; }
  .addr-acts .btn { flex: 1; }
  .since { margin-left: 0; }
  .custom-row .field-sm { flex: 1 1 100%; }
  .custom-row .at { display: none; }
  .ctl, .ctl select { width: 100%; }
  .custom-row .btn { width: 100%; }
  .table-toolbar { gap: .5rem; }
  .toolbar-spacer { display: none; }
  .mail-frame { height: 60vh; }
  .toasts { left: 1rem; right: 1rem; bottom: 1rem; }
  .toast { max-width: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .12); border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .2); background-clip: content-box; }

::selection { background: rgba(109, 124, 255, .35); }
:focus-visible { outline: 2px solid var(--accent-2); outline-offset: 2px; }
