/* ==========================================================================
   FarmBov — Design System Tokens
   ========================================================================== */

:root {
  /* Primary */
  --primary-600: #1A6B35;
  --primary-500: #228B44;
  --primary-400: #2DAD57;
  --primary-100: #E8F5ED;
  --primary-50:  #F4FAF6;

  /* Neutral */
  --neutral-900: #111827;
  --neutral-700: #374151;
  --neutral-500: #6B7280;
  --neutral-400: #9CA3AF;
  --neutral-300: #D1D5DB;
  --neutral-200: #E5E7EB;
  --neutral-100: #F3F4F6;
  --neutral-50:  #F9FAFB;
  --white: #FFFFFF;

  /* Semantic */
  --success-600: #16A34A;
  --success-100: #DCFCE7;
  --warning-600: #D97706;
  --warning-100: #FEF3C7;
  --danger-600:  #DC2626;
  --danger-100:  #FEE2E2;
  --info-600:    #2563EB;
  --info-100:    #DBEAFE;

  /* Elevation */
  --elev-1: 0 1px 3px rgba(0,0,0,0.08), 0 1px 2px rgba(0,0,0,0.04);
  --elev-2: 0 4px 12px rgba(0,0,0,0.10), 0 2px 4px rgba(0,0,0,0.06);
  --elev-3: 0 8px 24px rgba(0,0,0,0.12);
  --elev-4: 0 16px 40px rgba(0,0,0,0.16);

  /* Radius */
  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-2xl: 24px;
  --r-full: 9999px;
}

* { box-sizing: border-box; }

/* Step flow — coluna com rodapé fixo no fim do scroll */
.fb-step-flow {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}
.fb-step-flow-bar {
  padding: 12px 20px 0;
  flex-shrink: 0;
  background: #fff;
}

html, body {
  margin: 0;
  padding: 0;
  font-family: 'DM Sans', -apple-system, system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
  background: #EFEFF4;
  color: var(--neutral-900);
}

/* Page background — soft warm-cool neutral so the frame sits nicely */
body {
  background:
    radial-gradient(ellipse at 20% 0%, #F4F8F4 0%, transparent 60%),
    radial-gradient(ellipse at 100% 100%, #ECEEF1 0%, transparent 50%),
    #EEF0EF;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 16px;
}

#root { display: flex; align-items: center; justify-content: center; }

/* Celular — só o protótipo, sem moldura nem menu de telas */
html.fb-standalone,
html.fb-standalone body {
  height: 100%;
  min-height: 100%;
  overflow: hidden;
}

html.fb-standalone body {
  display: block;
  padding: 0;
  background: var(--neutral-50);
}

html.fb-standalone #root {
  display: block;
  width: 100%;
  height: 100%;
  height: 100dvh;
}

.fb-mobile-shell {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  background: var(--neutral-50);
}

html.fb-standalone .fb-app > .fb-scroll {
  padding-top: env(safe-area-inset-top, 0px) !important;
}

html.fb-standalone .fb-home-header {
  padding-top: calc(12px + env(safe-area-inset-top, 0px)) !important;
}

html.fb-standalone .fb-bottom-nav {
  padding-bottom: calc(8px + env(safe-area-inset-bottom, 0px)) !important;
}

/* DM Sans utility — frame children inherit via inline style; this is fallback */
.fb-app, .fb-app * { font-family: 'DM Sans', system-ui, sans-serif; }

/* Phosphor icons resize via font-size */
.fb-app i[class^="ph-"], .fb-app i[class*=" ph-"] { display: inline-flex; }

/* Hide scrollbars within the phone frame for a cleaner look */
.fb-scroll::-webkit-scrollbar { width: 0; height: 0; }
.fb-scroll { scrollbar-width: none; }

/* ==========================================================================
   Tap feedback
   ========================================================================== */
.fb-tap {
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform 120ms ease, background-color 120ms ease, opacity 120ms ease;
  user-select: none;
}
.fb-tap:active { transform: scale(0.975); opacity: 0.92; }

/* ==========================================================================
   Typography helpers
   ========================================================================== */
.t-display-xl { font-size: 32px; font-weight: 700; line-height: 1.2; letter-spacing: -0.02em; }
.t-display-lg { font-size: 28px; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
.t-h1 { font-size: 22px; font-weight: 600; line-height: 1.3; letter-spacing: -0.01em; }
.t-h2 { font-size: 18px; font-weight: 600; line-height: 1.35; letter-spacing: -0.01em; }
.t-h3 { font-size: 16px; font-weight: 600; line-height: 1.4; }
.t-body-lg { font-size: 15px; font-weight: 400; line-height: 1.5; }
.t-body-md { font-size: 14px; font-weight: 400; line-height: 1.5; }
.t-body-sm { font-size: 13px; font-weight: 400; line-height: 1.5; }
.t-label-lg { font-size: 15px; font-weight: 500; line-height: 1.3; }
.t-label-md { font-size: 14px; font-weight: 500; line-height: 1.3; }
.t-caption { font-size: 12px; font-weight: 400; line-height: 1.4; }
.t-overline {
  font-size: 11px; font-weight: 500; line-height: 1.3;
  text-transform: uppercase; letter-spacing: 0.08em;
}

.c-900 { color: var(--neutral-900); }
.c-700 { color: var(--neutral-700); }
.c-500 { color: var(--neutral-500); }
.c-400 { color: var(--neutral-400); }
.c-white { color: var(--white); }
.c-primary { color: var(--primary-600); }
.c-danger { color: var(--danger-600); }
.c-warning { color: var(--warning-600); }
.c-success { color: var(--success-600); }

/* ==========================================================================
   Sheet animations
   ========================================================================== */
@keyframes fb-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes fb-sheet-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}
@keyframes fb-slide-in {
  from { transform: translateX(20px); opacity: 0; }
  to { transform: translateX(0); opacity: 1; }
}
@keyframes fb-pop {
  0%   { transform: scale(0.92); opacity: 0; }
  100% { transform: scale(1); opacity: 1; }
}
@keyframes fb-bt-wave {
  0%   { transform: scale(1); opacity: 0.55; }
  100% { transform: scale(2.6); opacity: 0; }
}

/* Bluetooth bastão — tela de busca */
.fb-bluetooth-scan {
  position: absolute;
  inset: 0;
  z-index: 80;
  background: var(--neutral-50);
  display: flex;
  flex-direction: column;
  padding: 50px 24px 32px;
  animation: fb-fade-in 220ms ease;
  overflow-y: auto;
}
.fb-bt-wave-wrap {
  position: relative;
  width: 128px;
  height: 128px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
}
.fb-bt-wave-ring {
  position: absolute;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--primary-400);
  animation: fb-bt-wave 2.2s ease-out infinite;
}

/* ==========================================================================
   Inputs — global so we don't fight react focus
   ========================================================================== */
.fb-input {
  width: 100%;
  height: 52px;
  border-radius: var(--r-md);
  border: 1px solid var(--neutral-300);
  background: var(--white);
  padding: 0 16px;
  font: 400 14px/1.5 'DM Sans', system-ui, sans-serif;
  color: var(--neutral-900);
  outline: none;
  transition: border-color 120ms ease, box-shadow 120ms ease;
}
.fb-input::placeholder { color: var(--neutral-400); }
.fb-input:focus {
  border: 2px solid var(--primary-500);
  padding: 0 15px;
}
.fb-input.has-prefix { padding-left: 44px; }
.fb-input.has-suffix { padding-right: 44px; }
.fb-input.has-prefix:focus { padding-left: 43px; }

.fb-input-wrap { position: relative; }
.fb-input-prefix, .fb-input-suffix {
  position: absolute; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center; justify-content: center;
  color: var(--neutral-400); font-size: 20px; pointer-events: none;
}
.fb-input-prefix { left: 14px; }
.fb-input-suffix { right: 14px; }
.fb-input-suffix.fb-tap { pointer-events: auto; cursor: pointer; }

.fb-textarea {
  width: 100%;
  border-radius: var(--r-md);
  border: 1px solid var(--neutral-300);
  background: var(--white);
  padding: 14px 16px;
  font: 400 14px/1.5 'DM Sans', system-ui, sans-serif;
  color: var(--neutral-900);
  outline: none;
  resize: none;
  min-height: 100px;
}
.fb-textarea:focus { border: 2px solid var(--primary-500); padding: 13px 15px; }

/* Inline icon-bg blocks (rounded square colored containers) */
.fb-icon-tile {
  width: 40px; height: 40px; border-radius: var(--r-lg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
