/* Dropt mobile capture -- warm, quiet, precise.
   Design values follow the project system: paper-white ground, one warm accent. */

:root {
  --paper: #f5f2ee;
  --card: #ffffff;
  --ink: #1a1814;
  --ink-2: #6b6560;
  --ink-3: #a09890;
  --accent: #f4511e;
  --accent-press: #d8400f;
  --line: #e8e4df;
  --ok: #4a7c59;
  --ok-soft: #dcebe0;

  --r-card: 18px;
  --r-field: 14px;
  --r-btn: 12px;

  --sh-sm: 0 1px 3px rgba(40, 30, 20, 0.06);
  --sh-md: 0 6px 18px rgba(40, 30, 20, 0.08);
  --sh-lg: 0 14px 40px rgba(40, 30, 20, 0.12);

  --ease: cubic-bezier(0.16, 1, 0.3, 1);

  font-family: "Inter", -apple-system, "PingFang SC", "Segoe UI", system-ui, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body { height: 100%; }

body {
  background: var(--paper);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  display: flex;
  justify-content: center;
  /* a soft stage so it also looks right in a desktop browser preview */
  padding: 0;
}

/* the phone canvas: fills the device on mobile, framed on desktop */
.app {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

/* ---- top bar ---- */
.bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 22px 6px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 17px; letter-spacing: -0.01em; }
.brand .mark {
  width: 22px; height: 22px; border-radius: 7px;
  background: var(--accent);
  display: grid; place-items: center;
  box-shadow: 0 2px 6px rgba(244, 81, 30, 0.35);
}
.brand .mark svg { width: 12px; height: 12px; display: block; }
.bar .ghost {
  border: none; background: transparent; color: var(--ink-3);
  width: 34px; height: 34px; border-radius: 9px; cursor: pointer;
  display: grid; place-items: center; transition: background 0.2s, color 0.2s;
}
.bar .ghost:hover { background: rgba(0,0,0,0.04); color: var(--ink-2); }

/* ---- main capture area ---- */
#capture { flex: 1; display: flex; flex-direction: column; }
.stage { flex: 1; display: flex; flex-direction: column; padding: 26px 22px 0; }

.title {
  font-family: "Lora", Georgia, serif;
  font-size: 30px; line-height: 1.18; font-weight: 600;
  letter-spacing: -0.01em; color: var(--ink);
}
.subtitle { margin-top: 8px; font-size: 15px; color: var(--ink-3); letter-spacing: -0.01em; }

.field {
  margin-top: 22px; position: relative; display: flex;
}
.field textarea {
  width: 100%; height: 168px; resize: none; border: 1px solid var(--line);
  background: var(--card); border-radius: var(--r-card);
  padding: 18px 18px 34px; font: inherit; font-size: 19px; line-height: 1.5;
  color: var(--ink); box-shadow: var(--sh-sm);
  transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
  outline: none;
}

/* recent drops — preview under the input (Capture) + full list (History) */
.recent { margin-top: 22px; display: flex; flex-direction: column; gap: 9px; }
.recent-label { font-size: 12px; color: var(--ink-3); letter-spacing: 0.08em; text-transform: uppercase; }
.recent-item { background: rgba(255,255,255,0.5); border: 1px solid var(--line); border-radius: 12px; padding: 11px 14px; }
.recent-item .rt { font-size: 15px; color: var(--ink-2); line-height: 1.4; }
.recent-item .rm { font-size: 11px; color: var(--ink-3); margin-top: 4px; font-variant-numeric: tabular-nums; }
.recent-empty { font-size: 14px; color: var(--ink-3); padding: 10px 2px; line-height: 1.5; }
.field textarea::placeholder { color: var(--ink-3); }
.field textarea:focus { border-color: rgba(244, 81, 30, 0.45); box-shadow: var(--sh-md); }
.counter {
  position: absolute; right: 16px; bottom: 14px;
  font-size: 12px; color: var(--ink-3);
  font-variant-numeric: tabular-nums; letter-spacing: 0.02em;
  opacity: 0; transition: opacity 0.25s;
}
.field.dirty .counter { opacity: 1; }

/* ---- bottom dock ---- */
.dock {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 22px calc(20px + env(safe-area-inset-bottom));
  border-top: 1px solid transparent;
}
.tabs { display: flex; gap: 22px; }
.tabs button {
  border: none; background: transparent; cursor: pointer;
  font: inherit; font-size: 15px; color: var(--ink-3);
  padding: 6px 2px; transition: color 0.2s;
}
.tabs button:hover { color: var(--ink-2); }
.tabs button.on { color: var(--ink); font-weight: 600; }

.send {
  width: 58px; height: 58px; border-radius: 50%; border: none; cursor: pointer;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  box-shadow: 0 8px 20px rgba(244, 81, 30, 0.4);
  transition: transform 0.25s var(--ease), background 0.2s, box-shadow 0.25s, opacity 0.2s;
}
.send svg { width: 24px; height: 24px; }
.send:active { transform: scale(0.94); background: var(--accent-press); }
.send:disabled { opacity: 0.4; box-shadow: none; cursor: default; transform: none; }

/* ---- overlay states: sending / delivered ---- */
.overlay {
  position: absolute; inset: 0; background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 22px; opacity: 0; pointer-events: none;
  transition: opacity 0.3s var(--ease);
}
.overlay.show { opacity: 1; pointer-events: auto; }
.overlay .label { font-size: 20px; font-weight: 600; letter-spacing: -0.01em; }
.overlay .stamp { font-size: 13px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

/* sending: waveform + ring */
.wave { display: flex; align-items: center; gap: 4px; height: 46px; }
.wave i {
  width: 4px; border-radius: 2px; background: var(--accent);
  animation: bounce 1s var(--ease) infinite;
}
.wave i:nth-child(odd) { background: rgba(244, 81, 30, 0.45); }
@keyframes bounce { 0%,100% { height: 10px; } 50% { height: 38px; } }
.ring {
  width: 40px; height: 40px; border-radius: 50%;
  border: 3px solid rgba(244, 81, 30, 0.25); border-top-color: var(--accent);
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* delivered: green check pop */
.check {
  width: 96px; height: 96px; border-radius: 50%; background: var(--ok-soft);
  display: grid; place-items: center;
  transform: scale(0); animation: pop 0.5s var(--ease) forwards;
}
.check svg { width: 44px; height: 44px; }
.check svg path { stroke-dasharray: 30; stroke-dashoffset: 30; animation: draw 0.4s var(--ease) 0.2s forwards; }
@keyframes pop { to { transform: scale(1); } }
@keyframes draw { to { stroke-dashoffset: 0; } }

/* ---- pairing screen ---- */
.pair { padding: 0 26px; flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 16px; }
.pair-art { display: flex; justify-content: center; margin-bottom: 6px; }
.pair-art svg { width: 190px; height: auto; }
.pair h1 { font-family: "Lora", Georgia, serif; font-size: 27px; font-weight: 600; letter-spacing: -0.01em; }
.pair p { color: var(--ink-2); font-size: 15px; line-height: 1.6; }

/* scan / paste segmented tabs */
.seg-tabs { display: flex; gap: 6px; background: rgba(0,0,0,0.045); padding: 5px; border-radius: 12px; }
.seg { flex: 1; border: none; background: transparent; font: inherit; font-size: 15px; font-weight: 600;
  color: var(--ink-3); padding: 11px; border-radius: 9px; cursor: pointer; transition: all 0.2s var(--ease); }
.seg.on { background: var(--card); color: var(--ink); box-shadow: var(--sh-sm); }
.scan-frame { position: relative; width: 100%; aspect-ratio: 1 / 1; border-radius: var(--r-card);
  overflow: hidden; background: #1c1917; box-shadow: var(--sh-md); }
.scan-frame video { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-reticle { position: absolute; inset: 17%; border: 3px solid rgba(255,255,255,0.92);
  border-radius: 22px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.22); }
.scan-hint { text-align: center; font-size: 14px; color: var(--ink-3); margin-top: 2px; }
.pair textarea {
  width: 100%; min-height: 96px; resize: none; border: 1px solid var(--line);
  border-radius: var(--r-field); background: var(--card); padding: 14px;
  font: inherit; font-size: 14px; color: var(--ink); box-shadow: var(--sh-sm); outline: none;
}
.pair textarea:focus { border-color: rgba(244,81,30,0.45); }
.btn {
  border: none; border-radius: var(--r-btn); cursor: pointer; font: inherit;
  font-size: 16px; font-weight: 600; padding: 15px; background: var(--accent); color: #fff;
  box-shadow: 0 6px 16px rgba(244,81,30,0.35); transition: transform 0.2s var(--ease), background 0.2s;
}
.btn:active { transform: scale(0.98); background: var(--accent-press); }
.hint { font-size: 13px; color: var(--ink-3); text-align: center; }

.hidden { display: none !important; }
