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

:root {
  --blue:    #1A56FF;
  --blue-lt: #EEF2FF;
  --green:   #22C55E;
  --gray-50: #F8FAFC;
  --gray-100:#F1F5F9;
  --gray-200:#E2E8F0;
  --gray-400:#94A3B8;
  --gray-600:#475569;
  --gray-900:#0F172A;
  --radius:  14px;
  --shadow:  0 2px 16px rgba(0,0,0,.07);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  background: #fff;
  color: var(--gray-900);
  min-height: 100vh;
}

/* ── Pages ────────────────────────────────────────────────────────────────── */
.page { display: none; min-height: 100vh; flex-direction: column; }
.page.active { display: flex; }

/* ── Topbar ──────────────────────────────────────────────────────────────── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 32px; height: 64px; border-bottom: 1px solid var(--gray-200);
}
.logo { font-size: 22px; font-weight: 700; }
.logo-paste { color: var(--gray-900); }
.logo-now   { color: var(--blue); }

.topbar-actions { display: flex; align-items: center; gap: 12px; }

.icon-btn {
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--gray-200); background: #fff;
  font-size: 16px; cursor: pointer; color: var(--gray-600);
  display: flex; align-items: center; justify-content: center;
}
.icon-btn:hover { background: var(--gray-100); }

.status-badge {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  border: 1px solid #D1FAE5; background: #F0FDF4;
  font-size: 14px; font-weight: 500; color: #15803D;
}
.status-dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--green);
}

/* ── Connect page ────────────────────────────────────────────────────────── */
.center-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 40px 16px;
}

.connect-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 20px; padding: 48px 56px;
  display: flex; flex-direction: column; align-items: center; gap: 16px;
  box-shadow: var(--shadow); max-width: 540px; width: 100%;
}

/* illustration */
.connect-illustration {
  display: flex; align-items: center; gap: 10px; margin-bottom: 8px;
}
.device {
  width: 72px; height: 108px; border-radius: 12px;
  border: 2px solid var(--gray-200); background: var(--gray-50);
  display: flex; align-items: center; justify-content: center; position: relative;
}
.phone-device { border-radius: 16px; }
.code-chip {
  background: #fff; border: 1px solid var(--gray-200); border-radius: 6px;
  font-size: 11px; font-weight: 700; padding: 4px 6px; color: var(--blue);
}
.mac-device { width: 96px; height: 72px; border-radius: 8px; }
.mac-icon { font-size: 24px; }
.link-circle {
  width: 36px; height: 36px; border-radius: 50%;
  background: var(--blue); display: flex; align-items: center; justify-content: center;
  font-size: 16px;
}
.dots { color: var(--gray-400); font-size: 18px; letter-spacing: 2px; }

.connect-card h1 { font-size: 26px; font-weight: 700; }
.subtitle { color: var(--gray-600); font-size: 15px; text-align: center; }

/* 6-digit boxes */
.code-inputs { display: flex; gap: 10px; margin: 8px 0; }
.code-box {
  width: 52px; height: 60px; border-radius: 10px;
  border: 1.5px solid var(--gray-200); background: var(--gray-50);
  font-size: 26px; font-weight: 700; text-align: center; color: var(--blue);
  outline: none; transition: border-color .15s;
}
.code-box:focus { border-color: var(--blue); background: var(--blue-lt); }

.error-msg { color: #EF4444; font-size: 13px; min-height: 18px; }

.btn-primary {
  background: var(--blue); color: #fff; border: none;
  padding: 14px 32px; border-radius: 12px; font-size: 16px; font-weight: 600;
  cursor: pointer; width: 100%; transition: opacity .15s;
}
.btn-primary:hover { opacity: .88; }
.btn-primary.wide { width: auto; padding: 14px 40px; }

.btn-ghost {
  background: #fff; color: var(--gray-600);
  border: 1px solid var(--gray-200); padding: 14px 24px;
  border-radius: 12px; font-size: 15px; font-weight: 500; cursor: pointer;
}
.btn-ghost:hover { background: var(--gray-100); }

.link-btn {
  background: none; border: none; color: var(--blue);
  font-size: 14px; cursor: pointer; font-weight: 500;
}
.link-btn:hover { text-decoration: underline; }

.trust-note {
  color: var(--gray-400); font-size: 13px;
  display: flex; align-items: center; gap: 4px;
}
.trust-note.center { justify-content: center; }

/* ── Paste page ───────────────────────────────────────────────────────────── */
.paste-layout {
  flex: 1; display: grid; grid-template-columns: 1fr 320px;
  gap: 0; overflow: hidden;
}

.paste-zone {
  border-right: 1px solid var(--gray-200);
  display: flex; align-items: center; justify-content: center;
  padding: 40px; cursor: default;
  border: 2px dashed var(--gray-200); margin: 32px; border-radius: 20px;
  transition: border-color .15s, background .15s;
}
.paste-zone.drag-over {
  border-color: var(--blue); background: var(--blue-lt);
}

.paste-hint {
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center;
}
.paste-icon { font-size: 48px; }
.paste-hint h2 { font-size: 26px; font-weight: 700; }
.paste-hint p  { color: var(--gray-600); font-size: 15px; }

.shortcut-pill {
  display: flex; align-items: center; gap: 6px;
  border: 1px solid var(--gray-200); border-radius: 8px;
  padding: 8px 14px; font-size: 14px; color: var(--gray-600);
  background: var(--gray-50);
}
.key-icon { font-size: 16px; }
kbd {
  background: var(--gray-100); border: 1px solid var(--gray-200);
  border-radius: 4px; padding: 2px 6px; font-family: inherit; font-size: 13px;
}

/* paste preview */
.paste-preview {
  width: 100%; display: flex; flex-direction: column; gap: 16px;
}
#preview-content {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 12px; padding: 16px; min-height: 80px;
  font-size: 15px; line-height: 1.6; color: var(--gray-900);
  max-height: 300px; overflow-y: auto; word-break: break-all;
}
#preview-content img { max-width: 100%; border-radius: 8px; }
#preview-content a { color: var(--blue); }

.send-row { display: flex; gap: 10px; }
.send-row .btn-primary { flex: 1; }

/* history panel */
.history-panel {
  padding: 32px 24px; display: flex; flex-direction: column; gap: 16px;
  background: var(--gray-50); border-left: 1px solid var(--gray-200);
}
.history-header {
  display: flex; align-items: center; justify-content: space-between;
}
.history-header h3 { font-size: 15px; font-weight: 600; }

.history-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.history-empty { color: var(--gray-400); font-size: 14px; }

.history-item {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 10px; padding: 12px 14px;
  display: flex; align-items: flex-start; gap: 10px;
}
.history-icon {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--blue-lt); display: flex; align-items: center;
  justify-content: center; font-size: 14px; flex-shrink: 0;
}
.history-meta { flex: 1; min-width: 0; }
.history-title {
  font-size: 13px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.history-time { font-size: 11px; color: var(--gray-400); }
.history-badge {
  font-size: 11px; font-weight: 500; color: #15803D;
  background: #F0FDF4; border: 1px solid #D1FAE5;
  border-radius: 100px; padding: 2px 8px; white-space: nowrap;
}

/* ── Success page ────────────────────────────────────────────────────────── */
.success-layout {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  gap: 24px; padding: 48px 24px;
}
.success-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 20px; padding: 40px 56px;
  display: flex; flex-direction: column; align-items: center; gap: 12px;
  text-align: center; box-shadow: var(--shadow); max-width: 640px; width: 100%;
}
.success-check {
  width: 56px; height: 56px; border-radius: 50%;
  background: #F0FDF4; color: var(--green); font-size: 28px; font-weight: 700;
  display: flex; align-items: center; justify-content: center;
}
.success-card h2 { font-size: 24px; font-weight: 700; }
.success-card p  { color: var(--gray-600); font-size: 15px; }

.history-card {
  background: #fff; border: 1px solid var(--gray-200);
  border-radius: 20px; padding: 28px 32px;
  display: flex; flex-direction: column; gap: 16px;
  box-shadow: var(--shadow); max-width: 840px; width: 100%;
}
.history-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.history-table th {
  text-align: left; color: var(--gray-400); font-weight: 500;
  padding: 0 0 12px; border-bottom: 1px solid var(--gray-200);
}
.history-table td { padding: 12px 0; border-bottom: 1px solid var(--gray-100); }
.history-table tr:last-child td { border-bottom: none; }

.item-cell { display: flex; align-items: center; gap: 10px; }
.item-icon {
  width: 36px; height: 36px; border-radius: 8px;
  background: var(--blue-lt); display: flex; align-items: center;
  justify-content: center; font-size: 16px; flex-shrink: 0;
}
.item-title { font-weight: 600; }
.item-sub   { color: var(--gray-400); font-size: 12px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 300px; }
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; font-weight: 500; color: #15803D;
  background: #F0FDF4; border: 1px solid #D1FAE5;
  border-radius: 100px; padding: 4px 10px;
}

.paste-new-row {
  display: flex; justify-content: center; padding-top: 4px;
}

/* ── Footer ──────────────────────────────────────────────────────────────── */
.page-footer {
  text-align: center; padding: 16px; font-size: 13px; color: var(--gray-400);
  border-top: 1px solid var(--gray-100);
}

/* ── Responsive ──────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
  .paste-layout { grid-template-columns: 1fr; }
  .history-panel { display: none; }
  .connect-card { padding: 32px 24px; }
  .code-box { width: 42px; height: 52px; font-size: 22px; }
}
