/* ── VARIABLES ──────────────────────────────────────────────── */
:root {
  --bg:       #f1f5f9;
  --surface:  #ffffff;
  --surface2: #f8fafc;
  --border:   rgba(0,0,0,.09);
  --primary:  #6366f1;
  --primary2: #4f46e5;
  --cyan:     #0891b2;
  --text:     #1e293b;
  --muted:    #64748b;
  --success:  #10b981;
  --radius:   14px;
  --shadow:   0 4px 24px rgba(0,0,0,.08);
}

/* ── RESET ──────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: 'Inter', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
}

/* ── HEADER ─────────────────────────────────────────────────── */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 40px;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(12px);
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
}

.logo-img {
  height: 58px;
  width: auto;
  object-fit: contain;
  display: block;
  filter: drop-shadow(0 2px 6px rgba(0,0,0,.15));
}

.logo-name {
  font-size: 1.2rem;
  font-weight: 800;
  color: #1e3a5f;
  letter-spacing: -.02em;
}

.logo-name strong {
  font-weight: 800;
  color: var(--primary2);
}

.tab-switcher {
  display: flex;
  gap: 4px;
  background: var(--surface2);
  padding: 4px;
  border-radius: 10px;
  border: 1px solid var(--border);
}

.tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 20px;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.tab:hover { color: var(--text); }

.tab.active {
  background: var(--primary);
  color: #fff;
  box-shadow: 0 0 16px rgba(99,102,241,.4);
}

/* ── SECTIONS ───────────────────────────────────────────────── */
.section {
  display: none;
  max-width: 720px;
  margin: 0 auto;
  padding: 48px 24px 80px;
}

.section.active { display: block; }

.hidden { display: none !important; }

/* ── HERO ───────────────────────────────────────────────────── */
.hero {
  text-align: center;
  margin-bottom: 40px;
}

.hero h1 {
  font-size: 2.25rem;
  font-weight: 700;
  letter-spacing: -.03em;
  background: linear-gradient(135deg, #1e293b 0%, var(--primary2) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 12px;
}

.hero p {
  color: var(--muted);
  font-size: 1rem;
}

.hero strong { color: var(--cyan); }

/* ── EMAIL CARD ─────────────────────────────────────────────── */
.email-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}

.card-label {
  display: block;
  font-size: .75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--muted);
  margin-bottom: 12px;
}

.email-row {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 14px 16px;
  margin-bottom: 16px;
}

.email-display {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 500;
  font-family: 'Courier New', monospace;
  color: var(--cyan);
  word-break: break-all;
  min-width: 0;
}

.btn-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}

.btn-icon:hover {
  border-color: var(--primary);
  color: var(--primary2);
  background: rgba(99,102,241,.1);
}

/* ── TIMER ──────────────────────────────────────────────────── */
.timer-wrap {
  display: flex;
  align-items: center;
  gap: 12px;
}

.timer-bar {
  flex: 1;
  height: 4px;
  background: var(--surface2);
  border-radius: 99px;
  overflow: hidden;
}

.timer-fill {
  height: 100%;
  width: 100%;
  background: linear-gradient(90deg, var(--primary), var(--cyan));
  border-radius: 99px;
  transition: width .5s linear, background-color .5s;
}

.timer-fill.warning { background: linear-gradient(90deg, #f59e0b, #ef4444); }

.timer-text {
  font-size: .8rem;
  font-weight: 600;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
  min-width: 38px;
  text-align: right;
}

/* ── INBOX ──────────────────────────────────────────────────── */
.inbox-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.inbox-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.inbox-header h3 {
  flex: 1;
  font-size: 1rem;
  font-weight: 600;
}

.badge {
  background: var(--primary);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 99px;
  min-width: 24px;
  text-align: center;
}

.inbox-meta { display: flex; align-items: center; gap: 10px; }

.btn-sm {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: transparent;
  color: var(--muted);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.btn-sm:hover { border-color: var(--primary); color: var(--primary2); }

.inbox-body { min-height: 200px; }

/* ── EMAIL ROWS ─────────────────────────────────────────────── */
.email-item {
  display: grid;
  grid-template-columns: 1fr auto;
  grid-template-rows: auto auto;
  gap: 2px 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  transition: background .15s;
}

.email-item:last-child { border-bottom: none; }
.email-item:hover { background: var(--surface2); }

.email-from {
  font-weight: 600;
  font-size: .9rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.email-time {
  font-size: .75rem;
  color: var(--muted);
  white-space: nowrap;
  grid-row: 1;
}

.email-subject {
  font-size: .85rem;
  color: var(--muted);
  grid-column: 1 / -1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ── EMPTY STATE ────────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 56px 24px;
  color: var(--muted);
  text-align: center;
}

.empty-state p { font-weight: 500; font-size: .95rem; }
.empty-state span { font-size: .82rem; opacity: .7; }

/* ── SPINNER ────────────────────────────────────────────────── */
.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--primary);
  border-radius: 50%;
  animation: spin .7s linear infinite;
  margin-bottom: 8px;
}

@keyframes spin { to { transform: rotate(360deg); } }

/* ── FILTER BAR ─────────────────────────────────────────────── */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 20px;
}

.filter-btn {
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: 99px;
  background: var(--surface);
  color: var(--muted);
  font-size: .8rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .15s;
  font-family: inherit;
}

.filter-btn:hover { border-color: var(--primary); color: var(--text); }
.filter-btn.active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* ── PAGINATION ──────────────────────────────────────────────── */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 24px;
}

.btn-page {
  padding: 8px 20px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.btn-page:hover:not(:disabled) { border-color: var(--primary); color: var(--primary2); }
.btn-page:disabled { opacity: .35; cursor: default; }

#page-info { font-size: .85rem; color: var(--muted); }

/* ── QUACKR LINK BUTTON ─────────────────────────────────────── */
.btn-quackr {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 6px 12px;
  border: 1px solid var(--primary);
  border-radius: 7px;
  background: rgba(99,102,241,.08);
  color: var(--primary2);
  font-size: .78rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  font-family: inherit;
}

.btn-quackr:hover { background: var(--primary); color: #fff; }

/* ── NUMBERS GRID ───────────────────────────────────────────── */
.numbers-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
}

.number-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 20px;
  cursor: pointer;
  transition: all .2s;
  position: relative;
  overflow: hidden;
}

.number-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(99,102,241,.08), rgba(34,211,238,.04));
  opacity: 0;
  transition: opacity .2s;
}

.number-card:hover {
  border-color: var(--primary);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(99,102,241,.2);
}

.number-card:hover::before { opacity: 1; }

.number-flag {
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.number-country {
  font-size: .75rem;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--muted);
  margin-bottom: 6px;
}

.number-value {
  font-size: .95rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: var(--cyan);
}

.number-cta {
  margin-top: 12px;
  font-size: .75rem;
  color: var(--primary2);
  font-weight: 500;
}

/* ── SMS VIEW ───────────────────────────────────────────────── */
.sms-header {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 20px;
}

.sms-header h3 {
  flex: 1;
  font-size: 1.1rem;
  font-weight: 600;
  font-family: 'Courier New', monospace;
  color: var(--cyan);
}

.btn-back {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all .2s;
  font-family: inherit;
}

.btn-back:hover { border-color: var(--primary); color: var(--primary2); }

.sms-list {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-height: 200px;
  box-shadow: var(--shadow);
}

.sms-item {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.sms-item:last-child { border-bottom: none; }

.sms-meta {
  display: flex;
  justify-content: space-between;
  margin-bottom: 8px;
}

.sms-from {
  font-size: .8rem;
  font-weight: 600;
  color: var(--primary2);
}

.sms-time {
  font-size: .75rem;
  color: var(--muted);
}

.sms-text {
  font-size: .9rem;
  color: var(--text);
  line-height: 1.5;
  word-break: break-word;
}

/* ── MODAL ──────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  backdrop-filter: blur(6px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: fadeIn .15s;
}

@keyframes fadeIn { from { opacity: 0; } }

.modal {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 18px;
  width: 100%;
  max-width: 640px;
  max-height: 85vh;
  overflow-y: auto;
  box-shadow: 0 24px 80px rgba(0,0,0,.8);
  animation: slideUp .2s;
}

@keyframes slideUp { from { transform: translateY(20px); opacity: 0; } }

.modal-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
}

.modal-head h3 {
  flex: 1;
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
}

.modal-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
  flex-shrink: 0;
}

.modal-close:hover { border-color: #ef4444; color: #ef4444; }

.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  padding: 12px 24px;
  border-bottom: 1px solid var(--border);
  font-size: .82rem;
  color: var(--muted);
}

.modal-body {
  padding: 20px 24px;
  font-size: .9rem;
  line-height: 1.7;
  color: var(--text);
  white-space: pre-wrap;
  word-break: break-word;
}

.modal-body iframe {
  width: 100%;
  border: none;
  min-height: 300px;
}

/* ── TOAST ──────────────────────────────────────────────────── */
.toast {
  position: fixed;
  bottom: 32px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  padding: 10px 20px;
  border-radius: 99px;
  font-size: .85rem;
  font-weight: 500;
  z-index: 300;
  animation: toastIn .2s;
  box-shadow: var(--shadow);
}

@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(10px); } }

/* ── RESPONSIVE ─────────────────────────────────────────────── */
@media (max-width: 600px) {
  .header { padding: 14px 16px; }
  .section { padding: 32px 16px 60px; }
  .hero h1 { font-size: 1.6rem; }
  .numbers-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .tab span { display: none; }
}
