/* ============================================================
   TempMail — styles.css
   Responsive layout + dark/light themes
   ============================================================ */

:root {
  --bg: #0b1020;
  --bg-soft: #121a30;
  --panel: #161f38;
  --panel-2: #1d2845;
  --border: #28324f;
  --text: #e8edf7;
  --text-soft: #a9b4cc;
  --muted: #7e8aa6;
  --brand: #5b8cff;
  --brand-2: #8a6cff;
  --accent: #2dd4bf;
  --danger: #ff5d6c;
  --warn: #ffb020;
  --ok: #36d399;
  --shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
  --radius: 14px;
}

[data-theme="light"] {
  --bg: #f4f7fc;
  --bg-soft: #eef2fa;
  --panel: #ffffff;
  --panel-2: #f3f6fc;
  --border: #e1e7f2;
  --text: #16203a;
  --text-soft: #44516e;
  --muted: #8290ab;
  --brand: #3f6fff;
  --brand-2: #7b5cff;
  --accent: #0ea5a0;
  --shadow: 0 10px 30px rgba(20, 33, 70, 0.10);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  background:
    radial-gradient(1200px 600px at 80% -10%, rgba(91, 140, 255, 0.18), transparent 60%),
    radial-gradient(900px 500px at -10% 0%, rgba(138, 108, 255, 0.16), transparent 55%),
    var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }

.container { width: min(1080px, 92%); margin: 0 auto; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(10px);
  background: color-mix(in srgb, var(--bg) 80%, transparent);
  border-bottom: 1px solid var(--border);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 0;
}
.logo {
  display: flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.25rem; color: var(--text);
}
.logo:hover { text-decoration: none; }
.logo .mark {
  width: 34px; height: 34px; border-radius: 10px;
  display: grid; place-items: center;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff; font-size: 1.1rem;
}
.nav { display: flex; align-items: center; gap: 18px; }
.nav a { color: var(--text-soft); font-weight: 600; }
.nav a:hover { color: var(--text); text-decoration: none; }

.theme-toggle {
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  width: 40px; height: 40px; border-radius: 10px;
  cursor: pointer; font-size: 1.1rem;
  display: grid; place-items: center;
  transition: transform .15s ease;
}
.theme-toggle:hover { transform: translateY(-1px); }

.nav-toggle { display: none; background: none; border: 0; color: var(--text); font-size: 1.6rem; cursor: pointer; }

/* ---------- Hero ---------- */
.hero { padding: 48px 0 24px; text-align: center; }
.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin: 0 0 10px;
  background: linear-gradient(135deg, var(--text), var(--brand));
  -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
}
.hero p.lead { color: var(--text-soft); font-size: 1.1rem; max-width: 640px; margin: 0 auto 8px; }
.badges { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 16px; }
.badge {
  font-size: .8rem; font-weight: 700; color: var(--text-soft);
  border: 1px solid var(--border); background: var(--panel);
  padding: 6px 12px; border-radius: 999px;
}

/* ---------- Generator card ---------- */
.app { padding: 12px 0 40px; }
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.generator { padding: 22px; }

.status-line {
  display: flex; align-items: center; gap: 8px;
  font-size: .85rem; color: var(--muted); margin-bottom: 14px;
}
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--warn); }
.dot.live { background: var(--ok); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ok) 25%, transparent); }
.dot.err { background: var(--danger); }

.address-row {
  display: flex; gap: 10px; align-items: stretch; flex-wrap: wrap;
}
.address-box {
  flex: 1 1 320px;
  display: flex; align-items: center; gap: 10px;
  background: var(--panel-2);
  border: 1px dashed var(--border);
  border-radius: 12px;
  padding: 14px 16px;
  min-height: 58px;
  font-size: 1.15rem; font-weight: 700;
  letter-spacing: .2px;
  word-break: break-all;
}
.address-box .email-icon { color: var(--brand); font-size: 1.2rem; }
#emailAddress.loading { color: var(--muted); font-weight: 600; font-size: 1rem; }

.btn {
  border: 0; border-radius: 12px; cursor: pointer;
  font-weight: 700; font-size: .95rem;
  padding: 0 18px; min-height: 58px;
  display: inline-flex; align-items: center; gap: 8px; justify-content: center;
  transition: transform .12s ease, opacity .12s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-primary { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; }
.btn-ghost { background: var(--panel-2); color: var(--text); border: 1px solid var(--border); }
.btn-sm { min-height: 40px; padding: 0 14px; font-size: .85rem; border-radius: 10px; }

/* Prominent call-to-action button (Generate New Email) — on-theme brand gradient */
.btn-cta {
  min-height: 52px;
  padding: 0 26px;
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: .3px;
  color: #fff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 8px 22px color-mix(in srgb, var(--brand) 38%, transparent);
}
.btn-cta:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 28px color-mix(in srgb, var(--brand) 55%, transparent);
}
.btn-cta .cta-icon { display: inline-block; }

/* ---------- Countdown ---------- */
.countdown { margin-top: 18px; }
.countdown .top { display: flex; justify-content: space-between; font-size: .9rem; color: var(--text-soft); margin-bottom: 6px; }
.countdown .time { font-weight: 800; color: var(--text); }
.progress { height: 8px; background: var(--panel-2); border-radius: 999px; overflow: hidden; border: 1px solid var(--border); }
.progress > span { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, var(--accent), var(--brand)); transition: width 1s linear; }
.progress.low > span { background: linear-gradient(90deg, var(--warn), var(--danger)); }

/* ---------- OTP banner ---------- */
.otp-banner {
  margin-top: 16px;
  display: none;
  align-items: center; justify-content: space-between; gap: 12px;
  background: linear-gradient(135deg, color-mix(in srgb, var(--accent) 22%, transparent), color-mix(in srgb, var(--brand) 16%, transparent));
  border: 1px solid color-mix(in srgb, var(--accent) 40%, var(--border));
  border-radius: 12px; padding: 12px 16px;
}
.otp-banner.show { display: flex; }
.otp-banner .otp-label { font-size: .8rem; color: var(--text-soft); }
.otp-banner .otp-code { font-size: 1.6rem; font-weight: 800; letter-spacing: 4px; color: var(--text); }

/* ---------- Inbox ---------- */
.inbox { margin-top: 22px; }
.inbox-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px; border-bottom: 1px solid var(--border);
}
.inbox-head h2 { margin: 0; font-size: 1.05rem; }
.inbox-head .count {
  background: var(--brand); color: #fff; font-size: .8rem; font-weight: 800;
  border-radius: 999px; padding: 2px 10px; margin-left: 8px;
}
.spin { display: inline-block; width: 16px; height: 16px; border: 2px solid var(--border); border-top-color: var(--brand); border-radius: 50%; animation: spin 0.8s linear infinite; }
.spin-lg { width: 36px; height: 36px; border-width: 3px; }
@keyframes spin { to { transform: rotate(360deg); } }

.msg-list { list-style: none; margin: 0; padding: 0; }
.msg-item {
  display: flex; align-items: center; gap: 14px;
  padding: 14px 18px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background .12s ease;
}
.msg-item:last-child { border-bottom: 0; }
.msg-item:hover { background: var(--panel-2); }
.msg-item .avatar {
  width: 42px; height: 42px; border-radius: 50%; flex: 0 0 auto;
  display: grid; place-items: center; font-weight: 800; color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
}
.msg-item .meta { flex: 1; min-width: 0; }
.msg-item .from { font-weight: 700; }
.msg-item .subject { color: var(--text-soft); font-size: .92rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.msg-item .time { color: var(--muted); font-size: .8rem; flex: 0 0 auto; }
.msg-item.unseen .from::before { content: "●"; color: var(--brand); font-size: .7rem; margin-right: 6px; vertical-align: middle; }

.empty-state { text-align: center; padding: 48px 20px; color: var(--muted); }
.empty-state .big { font-size: 2.4rem; margin-bottom: 6px; }
.empty-state .hint { font-size: .9rem; }

/* ---------- How it works strip ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 22px; }
.step { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 18px; }
.step .num { width: 30px; height: 30px; border-radius: 8px; background: var(--panel-2); color: var(--brand); font-weight: 800; display: grid; place-items: center; margin-bottom: 10px; }
.step h3 { margin: 0 0 4px; font-size: 1rem; }
.step p { margin: 0; color: var(--text-soft); font-size: .92rem; }

/* ---------- Content sections ---------- */
.section { padding: 46px 0; }
.section h2 { font-size: 1.6rem; margin: 0 0 6px; }
.section .sub { color: var(--text-soft); margin: 0 0 24px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.feature { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.feature .ico { font-size: 1.6rem; }
.feature h3 { margin: 10px 0 6px; font-size: 1.05rem; }
.feature p { margin: 0; color: var(--text-soft); font-size: .93rem; }

/* comparison table */
.compare { width: 100%; border-collapse: collapse; background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.compare th, .compare td { padding: 14px 16px; text-align: left; border-bottom: 1px solid var(--border); }
.compare thead th { background: var(--panel-2); }
.compare tr:last-child td { border-bottom: 0; }
.compare .yes { color: var(--ok); font-weight: 700; }
.compare .no { color: var(--danger); font-weight: 700; }

/* FAQ */
.faq details { background: var(--panel); border: 1px solid var(--border); border-radius: 12px; padding: 4px 18px; margin-bottom: 12px; }
.faq summary { cursor: pointer; font-weight: 700; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--brand); font-size: 1.4rem; }
.faq details[open] summary::after { content: "−"; }
.faq p { margin: 0 0 16px; color: var(--text-soft); }

/* ---------- Modal (message viewer) ---------- */
.modal {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(4, 8, 20, 0.6);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.modal.show { display: flex; }
.modal-box {
  background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius); width: min(760px, 100%);
  max-height: 88vh; display: flex; flex-direction: column; box-shadow: var(--shadow);
}
.modal-head { padding: 18px 20px; border-bottom: 1px solid var(--border); }
.modal-head .subj { font-size: 1.15rem; font-weight: 800; margin: 0 0 6px; }
.modal-head .from { color: var(--text-soft); font-size: .9rem; }
.modal-close { position: absolute; top: 14px; right: 18px; background: none; border: 0; color: var(--text); font-size: 1.8rem; cursor: pointer; }
.modal-body { padding: 0; overflow: auto; flex: 1; }
.modal-body iframe { width: 100%; min-height: 360px; border: 0; background: #fff; }
.attachments { padding: 14px 20px; border-top: 1px solid var(--border); }
.attachments h4 { margin: 0 0 8px; font-size: .9rem; color: var(--text-soft); }
.attachments a { display: inline-flex; align-items: center; gap: 6px; margin: 4px 8px 4px 0; padding: 6px 12px; border: 1px solid var(--border); border-radius: 8px; background: var(--panel-2); }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--text); color: var(--bg); padding: 12px 20px; border-radius: 10px;
  font-weight: 700; opacity: 0; pointer-events: none; transition: all .25s ease; z-index: 200;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); padding: 30px 0; margin-top: 30px; }
.site-footer .container { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.site-footer a { color: var(--text-soft); margin-right: 16px; }
.site-footer .muted { color: var(--muted); font-size: .85rem; }

/* ---------- Generic content pages ---------- */
.page { padding: 40px 0 20px; }
.page h1 { font-size: 2rem; margin: 0 0 8px; }
.page .updated { color: var(--muted); font-size: .85rem; margin-bottom: 24px; }
.page h2 { margin-top: 28px; }
.page p, .page li { color: var(--text-soft); }
.prose { background: var(--panel); border: 1px solid var(--border); border-radius: var(--radius); padding: 26px 30px; }

.contact-form { display: grid; gap: 14px; max-width: 520px; }
.contact-form label { font-weight: 700; font-size: .9rem; }
.contact-form input, .contact-form textarea {
  width: 100%; padding: 12px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--panel-2); color: var(--text); font: inherit;
}

/* ---------- Responsive ---------- */
@media (max-width: 760px) {
  .nav { position: fixed; inset: 64px 0 auto 0; flex-direction: column; background: var(--panel); border-bottom: 1px solid var(--border); padding: 16px; gap: 14px; display: none; }
  .nav.open { display: flex; }
  .nav-toggle { display: block; }
  .steps, .grid-3 { grid-template-columns: 1fr; }
  .address-box { font-size: 1rem; }
  .compare th, .compare td { padding: 10px; font-size: .9rem; }
}
