@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 800;
  font-display: swap;
  src: url('/fonts/inter-var.woff2') format('woff2');
}
@font-face {
  font-family: 'JetBrains Mono';
  font-style: normal;
  font-weight: 500 700;
  font-display: swap;
  src: url('/fonts/jetbrains-mono-var.woff2') format('woff2');
}

:root {
  --bg-dark: #0b1320;
  --bg-dark-2: #101a2b;
  --teal: #2dd4bf;
  --teal-dark: #0a7a6d;
  --blue: #3b82f6;
  --text-light: #eef2f7;
  --text-muted: #93a1b5;
  --border-dark: #1f2b3d;
  --bg-light: #f4f7fa;
  --white: #ffffff;
  --ink: #16202e;
  --ink-muted: #000000;
  --radius-lg: 18px;
  --radius-md: 12px;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.06);
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 20px 50px rgba(8, 15, 30, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg-light);
  color: var(--ink);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.mono { font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace; }

a { color: inherit; }

.container {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Top bar */
.topbar {
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border-dark);
  position: sticky;
  top: 0;
  z-index: 20;
}
.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
}
.logo {
  display: flex;
  align-items: center;
  text-decoration: none;
  line-height: 0;
}
.logo-mark {
  height: 26px;
  width: auto;
  display: block;
}

.topnav {
  display: flex;
  align-items: center;
  gap: 6px;
}
.nav-link {
  color: var(--text-muted);
  text-decoration: none;
  padding: 9px 16px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
  transition: color 0.15s, background 0.15s;
}
.nav-link:hover {
  color: var(--text-light);
  background: rgba(255,255,255,0.06);
}

.nav-toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
  flex-shrink: 0;
}
.nav-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(4, 8, 16, 0.55);
  z-index: 29;
}
.nav-overlay.open { display: block; }

.mobile-nav {
  display: flex;
  flex-direction: column;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 80%;
  max-width: 300px;
  background: var(--bg-dark);
  border-left: 1px solid var(--border-dark);
  
  z-index: 30;
  padding-bottom: 16px;
  transform: translateX(100%);
  transition: transform 0.25s ease;
  gap: 0;
  overflow-y: auto;
}
.mobile-nav.open { transform: translateX(0); }
.mobile-nav-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border-dark);
  margin-bottom: 6px;
}
.mobile-nav-title {
  color: var(--text-light);
  font-weight: 700;
  font-size: 15px;
}
.nav-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  background: none;
  border: 1px solid var(--border-dark);
  border-radius: 8px;
  color: var(--text-light);
  cursor: pointer;
}
.mobile-nav .nav-link {
  padding: 16px 20px;
  border-radius: 0;
  border-bottom: 1px solid var(--border-dark);
}

/* Breadcrumbs */
.breadcrumbs {
  background: var(--bg-dark-2);
  border-bottom: 1px solid var(--border-dark);
}
.breadcrumbs ol {
  list-style: none;
  display: flex;
  gap: 8px;
  padding: 10px 0;
  font-size: 13px;
  color: var(--text-muted);
}
.breadcrumbs li + li::before {
  content: '/';
  margin-right: 8px;
  color: #3a4a63;
}
.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}
.breadcrumbs a:hover { color: var(--teal); }
.breadcrumbs li[aria-current="page"] { color: var(--text-light); }

/* Hero */
.hero {
  background: linear-gradient(160deg, var(--bg-dark) 0%, var(--bg-dark-2) 100%);
  padding: 56px 0 64px;
}
.email-card {
  width: 100%;
  background: rgba(255,255,255,0.02);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-lg);
  padding: 44px 36px;
  text-align: center;
  
}
.email-card h1 {
  color: var(--text-light);
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 26px;
}
.email-box {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #0f1826;
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  padding: 14px 16px;
  justify-content: space-between;
}
.email-address {
  font-family: 'JetBrains Mono', ui-monospace, monospace;
  color: var(--text-light);
  font-size: 17px;
  font-weight: 600;
  overflow-wrap: anywhere;
  text-align: left;
  flex: 1;
}
.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #1c2940;
  color: var(--text-light);
  border: none;
  border-radius: 50%;
  width: 40px;
  height: 40px;
  cursor: pointer;
  flex-shrink: 0;
  transition: transform 0.12s, background 0.15s;
}
.icon-btn.accent-btn {
  background: var(--teal);
  color: #06231f;
}
.icon-btn:hover { transform: translateY(-1px); }
.icon-btn:active { transform: translateY(0); }
.hero-desc {
  color: var(--text-muted);
  margin-top: 24px;
  font-size: 14.5px;
  line-height: 1.75;
}
.expiry-note {
  margin-top: 14px;
  font-size: 12.5px;
  color: var(--text-muted);
}

/* Actions */
.actions {
  background: var(--white);
  border-bottom: 1px solid #e8ecf1;
}
.actions-inner {
  display: flex;
  gap: 12px;
  justify-content: center;
  padding: 22px 0;
  flex-wrap: wrap;
}
.action-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--bg-light);
  border: 1px solid #dde3ea;
  border-radius: 24px;
  padding: 11px 22px;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  color: var(--ink);
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.action-btn:hover {
  background: #e6f9f6;
  border-color: var(--teal);
  transform: translateY(-1px);
}
.action-btn svg { flex-shrink: 0; }
.action-btn:disabled,
.action-btn.is-cooldown {
  cursor: not-allowed;
  transform: none;
  background: var(--bg-light);
  border-color: #dde3ea;
  color: var(--ink);
}

/* Inbox */
.inbox-section {
  padding: 44px 0;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 36px 20px;
}
.empty-state p { color: var(--ink); font-size: 14px; }
.mail-clock {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--teal-dark);
}
.mail-clock .clock-track { stroke: #dde3ea; }
.mail-clock .clock-fill {
  stroke: var(--teal-dark);
  stroke-dasharray: 97.4;
  animation: clockSweep 5s linear infinite;
}
.mail-clock .clock-hand { stroke: var(--teal-dark); }
@keyframes clockSweep {
  from { stroke-dashoffset: 97.4; }
  to { stroke-dashoffset: 0; }
}

.progress-row .progress-cell { padding: 0; border: 0; }
.mail-progress {
  height: 3px;
  width: 100%;
  background: rgba(255, 255, 255, 0.14);
  overflow: hidden;
}
.mail-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--teal);
  animation: progressFill 5s linear infinite;
}
@keyframes progressFill {
  from { width: 0%; }
  to { width: 100%; }
}

.spinner {
  display: inline-block;
  width: 15px;
  height: 15px;
  border: 2px solid #dde3ea;
  border-top-color: var(--teal-dark);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: -3px;
  margin-right: 4px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.inbox-scroll {
  max-height: 500px;
  overflow-y: auto;
  background: var(--white);
  
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}
.inbox-table {
  width: 100%;
  border-collapse: collapse;
}
.inbox-table thead {
  background: #f8fafc;
  position: sticky;
  top: 0;
  z-index: 1;
  border-bottom: 1px solid #e2e8f0;
}
.inbox-table th {
  color: #475569;
  text-align: left;
  padding: 16px 24px;
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.inbox-table .view-col { text-align: right; }
.inbox-table td {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14.5px;
  color: #334155;
}
.inbox-table tbody tr:last-child td { border-bottom: none; }
.inbox-table tbody tr:hover td { background: #fafcfe; }
.sender-cell { color: var(--ink); font-weight: 600; }
.subject-cell { max-width: 360px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.view-btn {
  display: inline-block;
  background: #f0fdfa;
  border: 1px solid #ccfbf1;
  border-radius: 6px;
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 600;
  color: #0f766e;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s;
}
.view-btn:hover { background: #e6f9f6; border-color: var(--teal); }
.empty-row td {
  text-align: center;
  color: var(--ink);
  padding: 0;
}

/* Info */
.info {
  background: var(--bg-light);
  padding: 8px 0 56px;
}
.info .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 22px;
}
.info h2, .info h3, .info p, .info ul, .info ol {
  width: 100%;
  text-align: left;
  margin: 0;
}
.info h2 {
  font-size: 24px;
  letter-spacing: -0.01em;
}
.info h3 {
  font-size: 17px;
}
.info p {
  color: var(--ink-muted);
  line-height: 1.8;
  font-size: 14.5px;
}
.info ul, .info .steps {
  color: var(--ink-muted);
  font-size: 14.5px;
  line-height: 1.8;
  padding-left: 22px;
}
.info ul li, .info .steps li {
  margin-bottom: 10px;
}
.info ul li:last-child, .info .steps li:last-child {
  margin-bottom: 0;
}
.info a { color: var(--teal-dark); text-decoration: underline; }

/* FAQ */
.faq-preview {
  background: var(--white);
  padding: 56px 0;
  border-top: 1px solid #e8ecf1;
}
.faq-preview .container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}
.faq-preview h2 {
  text-align: center;
  font-size: 24px;
  letter-spacing: -0.01em;
  width: 100%;
}
.faq-list {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.faq-list details {
  border: 1px solid #e8ecf1;
  border-radius: var(--radius-md);
  padding: 16px 20px;
}
.faq-list summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.faq-list summary::after {
  content: '+';
  font-size: 20px;
  color: var(--teal-dark);
  margin-left: 12px;
}
.faq-list details[open] summary::after { content: '\2212'; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list p {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 14px;
  line-height: 1.7;
}
.faq-more { text-align: center; width: 100%; }
.faq-more a { color: var(--teal-dark); font-weight: 600; text-decoration: none; }
.faq-more a:hover { text-decoration: underline; }

/* Message page */
.message-page { padding: 32px 0 64px; }
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 18px;
}
.back-link:hover { color: var(--teal-dark); }
.message-card {
  background: var(--white);
  border-radius: var(--radius-lg);
  
  padding: 32px;
  min-height: 400px;
}
.message-loading, .message-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 320px;
  color: var(--ink-muted);
  font-size: 14px;
  text-align: center;
}
.message-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.message-content h1 {
  font-size: 22px;
  letter-spacing: -0.01em;
  word-break: break-word;
}
.message-meta {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 24px 28px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  margin-bottom: 24px;
}
.message-meta > div { display: flex; gap: 16px; font-size: 14px; align-items: flex-start; }
.message-meta dt { color: #64748b; min-width: 80px; font-weight: 700; text-transform: uppercase; font-size: 12px; letter-spacing: 0.05em; padding-top: 1px; }
.message-meta dd { color: #0f172a; word-break: break-word; margin: 0; font-weight: 500; }
.message-frame {
  width: 100%;
  min-height: 200px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  background: #ffffff;
  
  overflow: hidden;
  transition: height 0.2s ease;
}

/* Toast */
.toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-dark);
  color: var(--text-light);
  padding: 12px 22px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 200;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* Footer */
.footer {
  background: var(--bg-dark);
  color: var(--text-muted);
  padding: 28px 0;
  font-size: 13px;
}
.footer-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  text-align: center;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 20px;
}
.footer-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
}
.footer-links a:hover { color: var(--teal); }
.footer-langs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 16px;
  max-width: 640px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding-top: 14px;
}
.footer-langs a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 12.5px;
}
.footer-langs a:hover { color: var(--teal); }

/* RTL (Arabic) readability */
[dir="rtl"] .page-content .container,
[dir="rtl"] .info .container { text-align: right; }
[dir="rtl"] .breadcrumbs ol { flex-direction: row-reverse; justify-content: flex-end; }
[dir="rtl"] .steps { padding-right: 20px; padding-left: 0; }

/* Static content pages (About/Privacy/Terms/FAQ) */
.page-content {
  background: var(--white);
  padding: 48px 0 64px;
}
.page-content .container {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.page-content h1 { font-size: 30px; letter-spacing: -0.02em; }
.page-content .updated { color: var(--ink); font-size: 13px; }
.page-content h2 { font-size: 19px; }
.page-content h3 { font-size: 16px; }
.page-content p, .page-content li { color: var(--ink-muted); font-size: 15px; line-height: 1.8; }
.page-content ul, .page-content ol { padding-left: 22px; }
.page-content ul li, .page-content ol li { margin-bottom: 10px; }
.page-content ul li:last-child, .page-content ol li:last-child { margin-bottom: 0; }
.page-content a { color: var(--teal-dark); text-decoration: underline; }

@media (max-width: 780px) {
  .topnav { display: none; }
  .nav-toggle { display: inline-flex; }

  .topbar-inner { height: 64px; }
  .logo-mark { height: 22px; }

  .container { padding: 0 20px; }

  .hero { padding: 32px 0 40px; }
  .email-card { padding: 24px 18px; text-align: left; }
  .email-card h1 { font-size: 22px; margin-bottom: 20px; }
  .email-box { flex-wrap: wrap; gap: 10px; padding: 12px 14px; }
  .email-address { font-size: 12.5px; }
  .icon-btn { width: 36px; height: 36px; }
  #qrBtn { display: none; }
  .hero-desc { font-size: 13.5px; margin-top: 18px; text-align: left; }
  .expiry-note { text-align: left; }

  .actions-inner {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 18px 0;
  }
  .action-btn {
    padding: 12px 10px;
    font-size: 13px;
    justify-content: center;
  }

  .inbox-section { padding: 28px 0; }
  .inbox-scroll {
  max-height: 500px;
  overflow-y: auto;
  background: var(--white);
  
  border: 1px solid #e2e8f0;
  border-radius: 12px;
}

  .inbox-table .table-head-row { display: none; }
  .inbox-table, .inbox-table tbody { display: block; width: 100%; }
  .inbox-table tbody tr {
    display: block;
    border-bottom: 1px solid #eef1f5;
    padding: 12px 16px;
  }
  .inbox-table tbody tr:last-child { border-bottom: none; }
  .inbox-table td {
  padding: 20px 24px;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14.5px;
  color: #334155;
}
  .inbox-table td[data-label]::before {
    content: attr(data-label);
    font-weight: 600;
    color: var(--ink-muted);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.03em;
    flex-shrink: 0;
  }
  .subject-cell { max-width: none; overflow: visible; white-space: normal; text-align: right; }
  .view-col { justify-content: flex-end; padding-top: 8px; }
  .empty-state { padding: 24px 16px; }

  .info .container { gap: 18px; }
  .info h2 { font-size: 20px; }
  .info h3 { font-size: 16px; }
  .info p, .info ul, .info .steps { font-size: 14px; }

  .faq-preview { padding: 36px 0; }
  .faq-preview h2 { font-size: 20px; }

  .page-content { padding: 32px 0 48px; }
  .page-content h1 { font-size: 24px; }
  .page-content .container { gap: 16px; }

  .message-card { padding: 22px 18px; }
  .message-content h1 { font-size: 19px; }
}
