/* TempMail — tadashi.tech
   Dark, amber accent, Geist-ish. Mobile-first. */

:root {
  --bg: #0b0b0c;
  --bg-2: #121214;
  --card: #161618;
  --card-2: #1c1c1f;
  --line: #26262a;
  --line-2: #33333a;
  --ink: #f2f2f3;
  --ink-2: #a1a1a8;
  --ink-3: #6c6c75;
  --accent: #f59e0b;
  --accent-soft: rgba(245, 158, 11, .12);
  --accent-line: rgba(245, 158, 11, .35);
  --ok: #34d399;
  --bad: #f87171;
  --r: 14px;
  --r-sm: 9px;
  --font: "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: "Geist Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--ink);
  min-height: 100svh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ---------- background grid ---------- */
.bg-grid {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.028) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 55% at 50% 0%, #000 30%, transparent 78%);
}

/* ---------- header ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(11,11,12,.82);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--line);
}

.brand { display: flex; align-items: center; gap: 9px; }
.logo { font-size: 20px; line-height: 1; }
.brand-txt { font-size: 16px; font-weight: 600; letter-spacing: -.02em; }
.brand-txt b { color: var(--accent); font-weight: 700; }

.pill {
  font-size: 11.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  color: var(--ink-2);
  white-space: nowrap;
}
.pill[data-state="live"]  { color: var(--ok);     border-color: rgba(52,211,153,.4);  background: rgba(52,211,153,.09); }
.pill[data-state="busy"]  { color: var(--accent); border-color: var(--accent-line);  background: var(--accent-soft); }
.pill[data-state="error"] { color: var(--bad);    border-color: rgba(248,113,113,.4); background: rgba(248,113,113,.09); }

/* ---------- layout ---------- */
.wrap {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 auto;
  padding: 26px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 20px;
}

/* ---------- typography ---------- */
.h1 {
  font-size: clamp(26px, 6.4vw, 38px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.08;
  margin-bottom: 10px;
}
.grad {
  background: linear-gradient(100deg, var(--accent), #fbbf24 55%, #fde68a);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.h2 { font-size: 15px; font-weight: 650; letter-spacing: -.01em; }
.sub { color: var(--ink-2); font-size: 14px; margin-bottom: 20px; }
.sub-sm { color: var(--ink-3); font-size: 12.5px; margin: 6px 0 14px; }

/* ---------- generator ---------- */
.gen-row {
  display: flex;
  gap: 10px;
  align-items: flex-end;
  flex-wrap: wrap;
}
.field { flex: 1 1 240px; min-width: 0; }
.field label {
  display: block;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 7px;
}

.input-wrap {
  display: flex;
  align-items: stretch;
  background: var(--bg-2);
  border: 1px solid var(--line-2);
  border-radius: var(--r-sm);
  overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.input-wrap:focus-within {
  border-color: var(--accent-line);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
#addrInput {
  flex: 1;
  min-width: 0;
  background: none;
  border: 0;
  outline: none;
  color: var(--ink);
  font-family: var(--mono);
  font-size: 14px;
  padding: 12px 13px;
}
#addrInput::placeholder { color: var(--ink-3); }
.domain-tag {
  display: flex;
  align-items: center;
  padding: 0 12px;
  background: rgba(255,255,255,.035);
  border-left: 1px solid var(--line);
  color: var(--ink-2);
  font-family: var(--mono);
  font-size: 13px;
  white-space: nowrap;
}

.hint-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}
.hint { font-size: 12.5px; color: var(--ink-3); }

/* ---------- buttons ---------- */
.btn {
  font-family: inherit;
  font-size: 13.5px;
  font-weight: 600;
  border: 1px solid var(--line-2);
  background: var(--card-2);
  color: var(--ink);
  padding: 10px 15px;
  border-radius: var(--r-sm);
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s, border-color .15s, transform .08s, opacity .15s;
  -webkit-tap-highlight-color: transparent;
}
.btn:hover  { background: #232327; border-color: #3d3d45; }
.btn:active { transform: scale(.975); }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #17120a;
}
.btn-primary:hover { background: #fbbf24; border-color: #fbbf24; }

.btn-big { padding: 12px 20px; font-size: 14px; position: relative; min-width: 128px; }

.btn-ghost { background: transparent; }
.btn-ghost:hover { background: rgba(255,255,255,.05); }
.btn-ghost.danger { color: var(--bad); }
.btn-ghost.danger:hover { background: rgba(248,113,113,.09); border-color: rgba(248,113,113,.35); }

.btn-sm { padding: 7px 11px; font-size: 12.5px; }

.btn-icon {
  background: transparent;
  border: 0;
  padding: 6px;
  font-size: 15px;
  line-height: 1;
  border-radius: 7px;
  cursor: pointer;
  opacity: .75;
  transition: opacity .15s, background .15s;
}
.btn-icon:hover { opacity: 1; background: rgba(255,255,255,.07); }

.btn-spin {
  display: none;
  width: 14px; height: 14px;
  border: 2px solid rgba(0,0,0,.25);
  border-top-color: #17120a;
  border-radius: 50%;
  animation: spin .6s linear infinite;
}
.btn.is-loading .btn-label { display: none; }
.btn.is-loading .btn-spin { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- error ---------- */
.err {
  margin-top: 14px;
  padding: 11px 13px;
  background: rgba(248,113,113,.09);
  border: 1px solid rgba(248,113,113,.3);
  border-radius: var(--r-sm);
  color: #fca5a5;
  font-size: 13px;
}

/* ---------- inbox ---------- */
.addr-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  margin-bottom: 16px;
}
.addr-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  color: var(--ink-3);
  text-transform: uppercase;
  letter-spacing: .07em;
  margin-bottom: 4px;
}
.addr-val { display: flex; align-items: center; gap: 4px; }
.addr-val code {
  font-family: var(--mono);
  font-size: 14.5px;
  font-weight: 600;
  color: var(--accent);
  word-break: break-all;
}
.addr-actions { display: flex; gap: 6px; flex-wrap: wrap; }

/* ---------- OTP strip ---------- */
.otp-strip {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding: 13px 15px;
  margin-bottom: 16px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: var(--r-sm);
  animation: pop .28s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px); } }
.otp-label {
  font-size: 11px;
  font-weight: 700;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: .07em;
}
.otp-body { display: flex; align-items: center; gap: 4px; }
.otp-body code {
  font-family: var(--mono);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .16em;
  color: var(--ink);
}
.otp-from { font-size: 12px; color: var(--ink-2); margin-left: auto; }

/* ---------- message list ---------- */
.msg-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.count { font-size: 12.5px; color: var(--ink-3); }

.msg-list { display: flex; flex-direction: column; gap: 8px; }

.msg {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  cursor: pointer;
  text-align: left;
  width: 100%;
  font-family: inherit;
  color: inherit;
  transition: border-color .15s, background .15s;
}
.msg:hover { border-color: var(--line-2); background: var(--card-2); }
.msg.is-open { border-color: var(--accent-line); }

.msg-ico {
  flex-shrink: 0;
  width: 34px; height: 34px;
  display: grid;
  place-items: center;
  background: rgba(255,255,255,.05);
  border-radius: 9px;
  font-size: 15px;
}
.msg-main { flex: 1; min-width: 0; }
.msg-from {
  font-size: 13.5px;
  font-weight: 650;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-subj {
  font-size: 13px;
  color: var(--ink-2);
  margin-top: 2px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.msg-time {
  flex-shrink: 0;
  font-size: 11.5px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.msg-body {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px dashed var(--line-2);
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.65;
  white-space: pre-wrap;
  word-break: break-word;
  max-height: 340px;
  overflow-y: auto;
}
.msg-body iframe {
  width: 100%;
  min-height: 200px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
}
.msg-otp {
  display: inline-block;
  margin-top: 10px;
  padding: 7px 12px;
  background: var(--accent-soft);
  border: 1px solid var(--accent-line);
  border-radius: 7px;
  font-family: var(--mono);
  font-size: 17px;
  font-weight: 700;
  letter-spacing: .14em;
  color: var(--accent);
}

/* ---------- empty ---------- */
.empty { text-align: center; padding: 34px 16px; color: var(--ink-3); }
.empty-ico { font-size: 30px; margin-bottom: 10px; opacity: .8; }
.empty p { font-size: 13.5px; }
.empty-sub { font-size: 12px; margin-top: 5px; opacity: .75; }

/* ---------- saved ---------- */
.saved-list { display: flex; flex-direction: column; gap: 8px; }
.saved-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 13px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
}
.saved-item code {
  flex: 1;
  min-width: 0;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.saved-item .btn { flex-shrink: 0; }

/* ---------- footer ---------- */
.foot {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 8px 16px 30px;
  font-size: 12px;
  color: var(--ink-3);
}
.foot .dot { margin: 0 7px; opacity: .5; }

/* ---------- toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translate(-50%, 18px);
  z-index: 100;
  background: var(--card-2);
  border: 1px solid var(--line-2);
  color: var(--ink);
  font-size: 13.5px;
  font-weight: 550;
  padding: 11px 18px;
  border-radius: 999px;
  box-shadow: 0 12px 34px rgba(0,0,0,.55);
  opacity: 0;
  pointer-events: none;
  transition: opacity .22s, transform .22s;
  max-width: calc(100vw - 32px);
  text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.ok   { border-color: rgba(52,211,153,.45); }
.toast.bad  { border-color: rgba(248,113,113,.45); }

/* ---------- responsive ---------- */
@media (max-width: 560px) {
  .wrap { padding: 18px 12px 32px; }
  .card { padding: 16px; }
  .gen-row { flex-direction: column; align-items: stretch; }
  .btn-big { width: 100%; }
  .addr-bar { flex-direction: column; align-items: stretch; }
  .addr-actions { justify-content: flex-end; }
  .otp-body code { font-size: 19px; }
  .otp-from { margin-left: 0; width: 100%; }
  .top { padding: 12px 14px; }
}

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