/* base.css — shared layout & components (part 1) */
* { box-sizing: border-box; margin: 0; padding: 0; }
:root { --radius: 18px; --radius-sm: 12px; --shadow: 0 10px 40px rgba(0,0,0,.12); }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg); color: var(--fg);
  min-height: 100vh; display: flex; flex-direction: column;
  -webkit-font-smoothing: antialiased;
}
body::before { content: ''; position: fixed; inset: 0; z-index: -1; pointer-events: none; background: var(--bg-orb); }
.wrap { max-width: 900px; margin: 0 auto; padding: 0 20px; width: 100%; }

/* header */
.site-head { position: sticky; top: 0; z-index: 60; backdrop-filter: blur(16px); background: var(--head-bg); border-bottom: 1px solid var(--border); }
.head-in { display: flex; align-items: center; justify-content: space-between; height: 62px; }
.brand { display: flex; gap: 10px; align-items: center; font-weight: 800; text-decoration: none; color: var(--fg); font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-size: 18px; letter-spacing: -.02em; }
.brand b { color: var(--accent); }
.head-nav a { margin-left: 20px; color: var(--muted); text-decoration: none; font-size: 14px; font-weight: 600; transition: color .15s; }
.head-nav a:hover { color: var(--accent); }

/* main / footer */
.main { flex: 1; padding: 56px 20px 80px; }
.site-foot { border-top: 1px solid var(--border); background: var(--head-bg); padding: 22px 0; }
.site-foot .wrap { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 13.5px; }
.site-foot b { color: var(--fg); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 1px solid transparent; border-radius: var(--radius-sm); cursor: pointer; font-family: inherit; font-size: 15px; font-weight: 700; padding: 12px 20px; text-decoration: none; transition: transform .12s, box-shadow .15s, background .15s, color .15s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-fg, #fff); box-shadow: 0 6px 24px var(--accent-glow, transparent); }
.btn-primary:hover { filter: brightness(1.07); }
.btn-ghost { background: transparent; border-color: var(--border); color: var(--fg); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn-danger-ghost { background: transparent; border-color: var(--border); color: #ef4444; }
.btn-danger-ghost:hover { border-color: #ef4444; }
.btn-xs { padding: 7px 12px; font-size: 13px; }
.icon-btn { background: none; border: 1px solid var(--border); color: var(--muted); border-radius: 10px; width: 34px; height: 34px; cursor: pointer; font-size: 15px; }
.icon-btn:hover { color: var(--accent); border-color: var(--accent); }
.link-btn { background: none; border: none; color: var(--accent); cursor: pointer; font: inherit; font-size: 13.5px; font-weight: 700; padding: 0; }
.link-btn:hover { text-decoration: underline; }

/* hero */
.hero { text-align: center; padding: 26px 0 10px; }
.hero-badge { display: inline-block; padding: 8px 16px; border-radius: 999px; font-size: 13px; font-weight: 600; border: 1px solid var(--border); background: var(--card); color: var(--muted); margin-bottom: 26px; }
.hero-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-size: clamp(34px, 6vw, 58px); line-height: 1.08; letter-spacing: -.03em; font-weight: 700; }
.grad-text { background: linear-gradient(120deg, var(--accent), var(--accent-2, var(--accent))); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-sub { max-width: 560px; margin: 18px auto 30px; color: var(--muted); font-size: 17px; line-height: 1.6; }
.welcome-box { max-width: 560px; margin: 0 auto 22px; padding: 14px 18px; border-radius: var(--radius-sm); background: var(--card); border: 1px solid var(--border); color: var(--fg); font-size: 14.5px; line-height: 1.55; }

/* create box */
.create-box { display: flex; align-items: stretch; max-width: 620px; margin: 0 auto; background: var(--card); border: 1px solid var(--border); border-radius: 16px; padding: 8px; box-shadow: var(--shadow); gap: 6px; }
.create-input { flex: 1; min-width: 0; border: none; outline: none; background: transparent; color: var(--fg); font-family: 'JetBrains Mono', monospace; font-size: 16px; padding: 12px 14px; }
.create-input::placeholder { color: var(--muted); opacity: .6; }
.create-at { display: flex; align-items: center; color: var(--muted); font-family: 'JetBrains Mono', monospace; font-size: 14.5px; padding: 0 4px; }
.create-btn { border-radius: 12px; padding: 12px 24px; }

/* features / steps */
.hero-feats { display: flex; flex-wrap: wrap; gap: 12px; justify-content: center; margin-top: 34px; }
.feat { display: flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--border); background: var(--card); font-size: 13.5px; font-weight: 600; color: var(--muted); }
.howto { margin-top: 70px; text-align: center; }
.howto h2 { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-size: 24px; margin-bottom: 26px; }
.steps { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; }
.step { flex: 1; min-width: 170px; max-width: 230px; padding: 22px 18px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--border); }
.step b { display: grid; place-items: center; width: 34px; height: 34px; margin: 0 auto 12px; border-radius: 50%; background: var(--accent); color: var(--accent-fg, #fff); font-size: 15px; }
.step p { color: var(--muted); font-size: 14px; line-height: 1.5; }

/* panels & inbox */
.panel { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); }
.inbox-head { display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap; padding: 22px 24px; margin-bottom: 18px; }
.inbox-label { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); font-weight: 700; margin-bottom: 6px; }
.inbox-addr { font-family: 'JetBrains Mono', monospace; font-size: 19px; font-weight: 600; display: flex; align-items: center; gap: 10px; word-break: break-all; }
.inbox-meta { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ttl { font-size: 13.5px; color: var(--muted); font-weight: 600; display: flex; align-items: center; gap: 6px; }
.ttl-val { font-family: 'JetBrains Mono', monospace; color: var(--accent); font-size: 15px; }

.inbox-list { overflow: hidden; }
.mail-item { display: flex; align-items: center; gap: 14px; padding: 15px 20px; cursor: pointer; border-bottom: 1px solid var(--border); transition: background .12s; }
.mail-item:last-child { border-bottom: none; }
.mail-item:hover { background: var(--hover, rgba(128,128,128,.06)); }
.mail-ic { font-size: 20px; }
.mail-main { flex: 1; min-width: 0; }
.mail-from { font-weight: 700; font-size: 14.5px; }
.unread .mail-from::after { content: '•'; color: var(--accent); margin-left: 6px; }
.unread .mail-subj { font-weight: 600; }
.mail-subj { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.read .mail-from, .read .mail-subj { opacity: .65; }
.mail-time { color: var(--muted); font-size: 12.5px; white-space: nowrap; }

.empty { text-align: center; padding: 54px 24px; }
.empty .big-icon, .expired-box .big-icon { font-size: 44px; margin-bottom: 12px; }
.empty h3, .expired-box h2 { font-family: var(--font-display, 'Space Grotesk'), sans-serif; margin-bottom: 8px; }
.empty p, .expired-box p { color: var(--muted); font-size: 14.5px; max-width: 420px; margin: 0 auto 18px; line-height: 1.55; }
.expired-box { text-align: center; padding: 60px 24px; }

/* modal */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.55); backdrop-filter: blur(6px); display: grid; place-items: center; z-index: 100; padding: 20px; }
.modal-card { width: 100%; max-width: 640px; max-height: 86vh; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: 20px; box-shadow: 0 30px 80px rgba(0,0,0,.4); overflow: hidden; }
.modal-head { display: flex; justify-content: space-between; gap: 14px; padding: 20px 24px 14px; border-bottom: 1px solid var(--border); }
.mail-modal-from { font-weight: 800; font-size: 16px; }
.mail-modal-subj { font-size: 14px; color: var(--muted); margin: 3px 0; }
.mail-modal-meta { font-size: 12.5px; color: var(--muted); }
.mail-modal-body { flex: 1; overflow: auto; padding: 22px 24px; font-size: 15px; line-height: 1.65; white-space: pre-wrap; word-break: break-word; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 24px; border-top: 1px solid var(--border); }

/* auth / user panels */
.auth-panel { max-width: 460px; margin: 20px auto; padding: 30px; }
.auth-panel h2 { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-size: 26px; margin-bottom: 20px; text-align: center; }
.stack { display: flex; flex-direction: column; gap: 14px; }
.stack label { display: flex; flex-direction: column; gap: 7px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.stack input, .inline-form input, .inline-form select, .grid-form input, .grid-form select { border: 1px solid var(--border); background: var(--bg-soft, var(--card)); color: var(--fg); border-radius: 11px; padding: 11px 14px; font: inherit; font-size: 14.5px; outline: none; }
.stack input:focus, .inline-form input:focus, .grid-form input:focus { border-color: var(--accent); }
.tabs { display: flex; gap: 6px; background: var(--bg-soft, var(--border)); padding: 5px; border-radius: 12px; margin-bottom: 18px; }
.tab { flex: 1; border: none; background: transparent; color: var(--muted); font: inherit; font-weight: 700; font-size: 14px; padding: 9px; border-radius: 9px; cursor: pointer; }
.tab.active { background: var(--card); color: var(--fg); box-shadow: 0 2px 8px rgba(0,0,0,.1); }
.form-err { background: rgba(239,68,68,.12); color: #ef4444; border: 1px solid rgba(239,68,68,.3); padding: 11px 14px; border-radius: 11px; font-size: 13.5px; font-weight: 600; }
.hint { color: var(--muted); font-size: 13px; line-height: 1.55; margin-top: 12px; }
.user-hello { margin-bottom: 18px; font-size: 15px; }
.sec-title { font-family: var(--font-display, 'Space Grotesk'), sans-serif; font-size: 18px; margin-bottom: 14px; }
.user-mb { display: flex; align-items: center; gap: 16px; padding: 16px 20px; margin-bottom: 12px; flex-wrap: wrap; }
.user-mb .inbox-addr { flex: 1; font-size: 16px; }
.user-mb-meta { color: var(--muted); font-size: 13px; }

/* toast */
.toast { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); background: var(--fg); color: var(--bg); padding: 12px 22px; border-radius: 999px; font-size: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.3); z-index: 200; animation: fadeup .25s ease; }
@keyframes fadeup { from { opacity: 0; transform: translate(-50%, 12px); } to { opacity: 1; transform: translate(-50%, 0); } }

/* responsive */
@media (max-width: 620px) {
  .create-box { flex-wrap: wrap; }
  .create-btn { width: 100%; }
  .create-at { padding: 0 10px 6px; }
  .inbox-head { flex-direction: column; align-items: flex-start; }
}

/* create box column (username + password) */
.create-box-col { flex-direction: column; align-items: stretch; gap: 8px; }
.create-row { display: flex; align-items: center; gap: 8px; border: 1px solid var(--border); border-radius: 12px; padding: 4px 6px 4px 4px; }
.create-row .create-input { border: none; }
.create-box-col .create-btn { width: 100%; }
