/* ============================================================================
 * 183 PWA — components.css
 * Split from the original single-file PWA. See styles/README.md for the
 * full layout map.
 * ========================================================================== */



/* ============================================================================
   Buttons
   ========================================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 18px;
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  transition: all 140ms ease;
  border: 1px solid transparent;
}

.btn:active { transform: scale(0.97); }

.btn-primary {
  background: var(--accent);
  color: var(--bg-deepest);
  font-weight: 600;
}
.btn-primary:hover { background: var(--accent-glow); box-shadow: 0 0 20px rgba(0, 224, 255, 0.32); }

.btn-ghost {
  background: var(--bg-raised);
  color: var(--text);
  border: 1px solid var(--line-strong);
}
.btn-ghost:hover { border-color: var(--line-glow); color: var(--accent); }

.btn-danger {
  background: rgba(255, 84, 112, 0.1);
  color: var(--fail);
  border: 1px solid rgba(255, 84, 112, 0.3);
}
.btn-danger:hover { background: rgba(255, 84, 112, 0.18); }

.btn-block { width: 100%; }
.btn-lg { padding: 13px 22px; font-size: 0.88rem; }

.fab {
  position: fixed;
  right: max(20px, calc(50vw - 270px + 20px));
  bottom: calc(92px + var(--sa-bot));
  width: 52px; height: 52px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--bg-deepest);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow:
    0 8px 24px rgba(0, 224, 255, 0.32),
    0 0 0 1px rgba(0, 224, 255, 0.5),
    0 0 20px rgba(0, 224, 255, 0.4);
  z-index: 40;
  transition: transform 160ms ease;
}
.fab:hover { transform: scale(1.04); }
.fab:active { transform: scale(0.95); }
.fab svg { width: 26px; height: 26px; stroke-width: 2; }



/* ============================================================================
   Form fields
   ========================================================================== */

.field {
  display: flex;
  flex-direction: column;
  gap: 5px;
  margin-bottom: 12px;
}

.field label {
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  font-weight: 500;
}

.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 11px 12px;
  background: var(--bg-base);
  border: 1px solid var(--line-strong);
  border-radius: var(--r-md);
  font-size: 0.95rem;
  color: var(--text);
  font-family: var(--sans);
  transition: border 160ms ease, box-shadow 160ms ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(0, 224, 255, 0.12);
}
.field input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(1) brightness(0.7);
  cursor: pointer;
}

.field-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.field-help {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin-top: 1px;
  font-family: var(--mono);
}

/* Slider */
.slider-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.slider-row input[type="range"] {
  flex: 1;
  -webkit-appearance: none;
  height: 4px;
  background: var(--bg-elevated);
  border-radius: 2px;
}
.slider-row input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--bg-deepest);
  box-shadow: 0 0 8px rgba(0, 224, 255, 0.5);
  cursor: pointer;
}
.slider-row .val {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--accent);
  min-width: 44px;
  text-align: right;
}

/* Segmented */
.segmented {
  display: flex;
  background: var(--bg-base);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 2px;
  gap: 1px;
}
.segmented button {
  flex: 1;
  padding: 8px 10px;
  border-radius: calc(var(--r-md) - 3px);
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: all 160ms;
}
.segmented button.active {
  background: var(--bg-elevated);
  color: var(--accent);
  box-shadow: 0 0 0 1px var(--line-glow);
}



/* ============================================================================
   Sheet / modal
   ========================================================================== */

.sheet-backdrop {
  position: fixed; inset: 0;
  background: rgba(5, 10, 20, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 100;
  opacity: 0; pointer-events: none;
  transition: opacity 200ms ease;
}
.sheet-backdrop.show { opacity: 1; pointer-events: auto; }

.sheet {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  max-width: 540px;
  margin: 0 auto;
  background: var(--bg-base);
  border-top: 1px solid var(--line-strong);
  border-top-left-radius: var(--r-xl);
  border-top-right-radius: var(--r-xl);
  padding: 20px 16px calc(20px + var(--sa-bot));
  box-shadow: 0 -16px 48px rgba(0, 0, 0, 0.5);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
  z-index: 101;
  max-height: 92vh;
  overflow-y: auto;
}
.sheet.show { transform: translateY(0); }

.sheet-handle {
  width: 32px; height: 3px;
  border-radius: 2px;
  background: var(--line-strong);
  margin: -8px auto 14px;
}



/* ============================================================================
   Toast
   ========================================================================== */

.toast {
  position: fixed;
  bottom: calc(92px + var(--sa-bot) + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--bg-elevated);
  color: var(--text);
  padding: 11px 18px;
  border-radius: var(--r-md);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  border: 1px solid var(--line-strong);
  opacity: 0;
  transition: all 200ms ease;
  z-index: 200;
  pointer-events: none;
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}
.toast.success { border-color: var(--pass); color: var(--pass); }
.toast.error { border-color: var(--fail); color: var(--fail); }



/* ============================================================================
   Empty
   ========================================================================== */

.empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-muted);
}
.empty h3 { color: var(--text); margin-bottom: 8px; }
.empty p { font-size: 0.88rem; }



/* ============================================================================
   Util
   ========================================================================== */

.hidden { display: none !important; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); border: 0;
}

