/* ════════════════════════════════════════════════════════════════════
 * Reusable components: buttons, cards, badges, icons, device frames,
 * phone mockup screens.
 * ════════════════════════════════════════════════════════════════════ */

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s2);
  padding: 14px 22px;
  border-radius: var(--r-pill);
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition:
    transform var(--dur-fast) var(--ease),
    box-shadow var(--dur) var(--ease),
    background-color var(--dur-fast) var(--ease),
    color var(--dur-fast) var(--ease);
  border: 2px solid transparent;
  text-decoration: none;
  position: relative;
}
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(0.97); }

.btn--primary {
  background: var(--grad-brand);
  color: var(--white);
  box-shadow: var(--shadow-lg);
}
.btn--primary:hover {
  color: var(--white);
  box-shadow: 0 24px 56px rgba(255, 107, 107, 0.32);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn--ghost:hover {
  background: var(--ink);
  color: var(--surface);
}

.btn--light {
  background: var(--white);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}
.btn--light:hover {
  color: var(--coral-deep);
  box-shadow: var(--shadow);
}

.btn--lg {
  padding: 18px 28px;
  font-size: 1rem;
}

.btn--sm {
  padding: 10px 16px;
  font-size: 0.85rem;
}

.btn .arrow {
  transition: transform var(--dur-fast) var(--ease);
}
.btn:hover .arrow {
  transform: translateX(3px);
}

/* ---------- Badges & pills ---------- */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--s2);
  padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.04em;
  background: var(--surface-warm);
  color: var(--coral-deep);
  border: 1px solid var(--line);
}
.badge .dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--green);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--green) 22%, transparent);
}

/* ---------- Cards ---------- */
.card {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s7);
  box-shadow: var(--shadow-sm);
  transition: transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.card--hover:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.card__icon {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--coral) 10%, transparent);
  color: var(--coral-deep);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-bottom: var(--s4);
}
.card__icon--sun {
  background: color-mix(in srgb, var(--sun) 18%, transparent);
  color: var(--accent-deep);
}
.card__icon--green {
  background: var(--green-soft);
  color: var(--green);
}

.card__title {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  margin-bottom: var(--s2);
  color: var(--ink);
}

.card__body {
  color: var(--ink-mute);
  font-size: 0.95rem;
  line-height: 1.6;
}

/* ---------- Icons ---------- */
.icon {
  width: 24px;
  height: 24px;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

/* ════════════════════════════════════════════════════════════════════
 * Device frames — phone, tablet, desktop, QR card.
 * Pure CSS, no images.
 * ════════════════════════════════════════════════════════════════════ */

.device-frame {
  position: relative;
  background: linear-gradient(160deg, #2D2D44 0%, #1A1A2E 100%);
  border-radius: 44px;
  padding: 14px;
  box-shadow:
    0 0 0 1.5px rgba(255, 255, 255, 0.04) inset,
    0 30px 70px -10px rgba(26, 26, 46, 0.45),
    0 60px 120px -30px rgba(255, 107, 107, 0.25);
  width: 320px;
  height: 660px;
  margin: 0 auto;
  flex-shrink: 0;
}

.device-frame__notch {
  position: absolute;
  top: 24px;
  left: 50%;
  transform: translateX(-50%);
  width: 110px;
  height: 28px;
  background: #0A0A14;
  border-radius: 999px;
  z-index: 4;
}

.device-screen {
  width: 100%;
  height: 100%;
  background: var(--surface);
  border-radius: 32px;
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
}

/* Status bar */
.device-status {
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--s5);
  padding-top: 6px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink);
  flex-shrink: 0;
}
.device-status__bars {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.device-status__bars .bar {
  width: 3px;
  background: var(--ink);
  border-radius: 1px;
}
.device-status__bars .bar:nth-child(1) { height: 4px; }
.device-status__bars .bar:nth-child(2) { height: 6px; }
.device-status__bars .bar:nth-child(3) { height: 8px; }
.device-status__bars .bar:nth-child(4) { height: 10px; }
.device-status__battery {
  width: 22px;
  height: 11px;
  border: 1.5px solid var(--ink);
  border-radius: 3px;
  position: relative;
  display: inline-block;
}
.device-status__battery::after {
  content: '';
  position: absolute;
  inset: 1.5px;
  background: var(--ink);
  border-radius: 1.5px;
  width: 70%;
}

/* Tablet variant */
.device-frame--tablet {
  width: 320px;
  height: 440px;
  border-radius: 36px;
  padding: 18px;
}
.device-frame--tablet .device-screen { border-radius: 22px; }
.device-frame--tablet .device-frame__notch { display: none; }

/* Desktop browser chrome */
.device-frame--desktop {
  width: 100%;
  max-width: 460px;
  height: 320px;
  background: linear-gradient(180deg, #E8E0CF 0%, #D7CBB0 100%);
  border-radius: 14px;
  padding: 0;
  box-shadow:
    0 30px 60px -10px rgba(26, 26, 46, 0.4),
    0 0 0 1px rgba(255, 255, 255, 0.4) inset;
}
.device-frame--desktop .device-frame__notch { display: none; }
.device-frame--desktop .device-screen { border-radius: 0 0 14px 14px; }
.device-chrome {
  height: 32px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  background: transparent;
}
.device-chrome__dot {
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: rgba(26, 26, 46, 0.2);
}
.device-chrome__dot:nth-child(1) { background: #FF6157; }
.device-chrome__dot:nth-child(2) { background: #FFBD2E; }
.device-chrome__dot:nth-child(3) { background: #28C840; }
.device-chrome__url {
  margin-left: 10px;
  flex: 1;
  height: 22px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 6px;
  font-size: 0.7rem;
  color: var(--ink-mute);
  display: flex;
  align-items: center;
  padding: 0 10px;
  font-family: var(--font-mono);
}

/* QR card (printed paper) */
.qr-card {
  width: 260px;
  aspect-ratio: 3 / 4;
  background: var(--white);
  border-radius: 18px;
  padding: var(--s6);
  box-shadow:
    0 20px 50px -10px rgba(26, 26, 46, 0.35),
    0 0 0 1px var(--line-soft);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: space-between;
  text-align: center;
  transform: rotate(-3deg);
  transition: transform var(--dur) var(--ease);
  position: relative;
  overflow: hidden;
}
.qr-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background:
    repeating-linear-gradient(45deg, transparent 0 12px, rgba(255, 107, 107, 0.03) 12px 13px);
  pointer-events: none;
}
.qr-card:hover { transform: rotate(0deg) translateY(-4px); }
.qr-card__brand {
  font-family: var(--font-display);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.qr-card__brand span { color: var(--coral); }
.qr-card__qr {
  width: 100%;
  aspect-ratio: 1;
  background: var(--white);
  border: 2px solid var(--ink);
  border-radius: 10px;
  padding: 10px;
  position: relative;
}
.qr-card__qr svg { width: 100%; height: 100%; display: block; }
.qr-card__instructions {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--ink-mute);
  text-transform: uppercase;
  letter-spacing: 0.1em;
}

/* ════════════════════════════════════════════════════════════════════
 * Phone screens — mini app UI inside .device-screen.
 * Mirrors the running app's visual language.
 * ════════════════════════════════════════════════════════════════════ */

.phone-content {
  padding: var(--s4) var(--s5);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: var(--s4);
  overflow: hidden;
}

.phone-appbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.phone-appbar__brand {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 800;
}
.phone-appbar__brand span { color: var(--coral); }
.phone-appbar__bell {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--surface-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--coral-deep);
}

/* Hero dashboard card (mirrors home.css .dash-hero) */
.mini-hero {
  position: relative;
  background: var(--grad-brand);
  color: var(--white);
  border-radius: var(--r-lg);
  padding: var(--s5);
  overflow: hidden;
  box-shadow: 0 12px 30px -10px rgba(255, 107, 107, 0.5);
}
.mini-hero::before {
  content: '';
  position: absolute;
  right: -40px;
  bottom: -40px;
  width: 160px;
  height: 160px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 50%;
}
.mini-hero__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  opacity: 0.85;
}
.mini-hero__balance {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  margin-top: var(--s2);
  line-height: 1;
}
.mini-hero__sub {
  font-size: 0.78rem;
  margin-top: var(--s2);
  opacity: 0.85;
}

/* Worker card (mirrors .tip-worker-card) */
.mini-worker {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--white);
  border-radius: var(--r);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
}
.mini-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--grad-brand);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 700;
  flex-shrink: 0;
}
.mini-worker__info { flex: 1; min-width: 0; }
.mini-worker__name {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
}
.mini-worker__meta {
  font-size: 0.72rem;
  color: var(--ink-mute);
  margin-top: 2px;
}
.mini-worker__rating {
  font-size: 0.7rem;
  color: var(--accent-deep);
  font-weight: 700;
  margin-top: 2px;
}

/* Stars row (mirrors app .stars-row) */
.mini-stars {
  display: flex;
  gap: 6px;
  justify-content: center;
  padding: var(--s2) 0;
}
.mini-star {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 2px solid var(--line);
  color: var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.mini-star.on {
  color: var(--accent);
  border-color: var(--accent);
}

/* Tip pills 2×2 (mirrors .tip-pills-grid) */
.mini-pills {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.mini-pill {
  background: var(--white);
  border: 2px solid var(--line);
  border-radius: 12px;
  padding: 12px 6px;
  text-align: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
}
.mini-pill.on {
  background: linear-gradient(135deg, #FF6B6B, #FFB36B);
  color: var(--white);
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(255, 107, 107, 0.3);
}

/* QR display card (worker home) */
.mini-qr {
  background: var(--white);
  border: 1px solid var(--line-soft);
  border-radius: var(--r-lg);
  padding: var(--s4);
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.mini-qr__svg {
  width: 100%;
  aspect-ratio: 1;
  max-width: 180px;
  margin: 0 auto;
  border: 2px solid var(--ink);
  border-radius: 12px;
  padding: 8px;
}
.mini-qr__svg svg { width: 100%; height: 100%; }
.mini-qr__caption {
  font-size: 0.7rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--ink-mute);
  margin-top: var(--s3);
}

/* Success burst */
.mini-burst {
  width: 64px;
  height: 64px;
  margin: var(--s5) auto var(--s3);
  border-radius: 50%;
  background: var(--green);
  color: var(--white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  font-weight: 700;
  box-shadow: 0 8px 20px rgba(29, 179, 134, 0.35);
}

.mini-success-title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  text-align: center;
  font-weight: 700;
}
.mini-success-sub {
  font-size: 0.78rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: var(--s2);
}

/* Mini CTA button inside a phone */
.mini-cta {
  background: var(--grad-brand);
  color: var(--white);
  border-radius: var(--r);
  padding: 12px;
  text-align: center;
  font-family: var(--font-body);
  font-weight: 800;
  font-size: 0.85rem;
  margin-top: auto;
  box-shadow: 0 8px 20px rgba(255, 107, 107, 0.3);
}

/* Section heading inside a phone */
.mini-h {
  font-family: var(--font-display);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  text-align: center;
}
.mini-sub {
  font-size: 0.72rem;
  color: var(--ink-mute);
  text-align: center;
  margin-top: -10px;
}
