/* ============================================================
   Truth Components v1.0
   Reusable UI primitives. One file, one source of truth.
   Naming: .t- prefix per Blueprint convention.
   ============================================================ */

/* ---- Header ---- */
.t-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  height: var(--header-height);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 max(var(--space-6), calc((100vw - 1080px) / 2));
  background: rgba(250,250,250,.88);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid transparent;
}

.t-header__logo {
  font-size: var(--text-xl);
  font-weight: var(--font-bold);
  letter-spacing: -0.02em;
}

.t-header__logo span {
  color: var(--color-brand-primary);
}

.t-header__right {
  display: flex;
  align-items: center;
  gap: var(--space-4);
}

/* ---- Button ---- */
.t-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  font-weight: var(--font-semibold);
  border-radius: var(--radius-lg);
  transition: background var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
  white-space: nowrap;
  user-select: none;
}

.t-button--primary {
  background: var(--color-brand-primary);
  color: #FFFFFF;
  box-shadow: var(--shadow-sm);
}
.t-button--primary:hover {
  background: var(--color-brand-hover);
}
.t-button--primary:active {
  background: var(--color-brand-active);
}
.t-button--primary:disabled {
  background: var(--color-brand-disabled);
  color: #FFFFFF;
  cursor: not-allowed;
}

.t-button--ghost {
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid var(--border-default);
}
.t-button--ghost:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.t-button--lg { height: 48px; padding: 0 var(--space-6); font-size: var(--text-md); }
.t-button--md { height: 40px; padding: 0 var(--space-5); font-size: var(--text-sm); }
.t-button--sm { height: 32px; padding: 0 var(--space-3); font-size: var(--text-xs); }

/* ---- Input ---- */
.t-input-group {
  position: relative;
  width: 100%;
}

.t-input {
  width: 100%;
  height: 68px;
  padding: 0 var(--space-5);
  background: #FFFFFF;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  font-size: var(--text-lg);
  font-weight: var(--font-regular);
  color: var(--text-primary);
  box-shadow: var(--shadow-sm);
  transition: border-color var(--duration-normal) var(--ease-standard),
              box-shadow var(--duration-normal) var(--ease-standard);
}

.t-input::placeholder {
  color: var(--text-tertiary);
}

.t-input:hover {
  border-color: var(--border-hover);
}

.t-input:focus {
  outline: none;
  border-color: var(--border-focus);
  box-shadow: 0 0 0 3px rgba(37,99,235,.08);
}

/* ---- Seed (brand component) ---- */
.t-seed {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #FFFFFF;
  border: 1px solid var(--color-brand-primary);
  box-shadow: 0 0 0 6px rgba(37,99,235,.06);
  animation: seed-breathe var(--duration-ambient) var(--ease-standard) infinite;
}

@keyframes seed-breathe {
  0%, 100% { transform: scale(1);   opacity: .85; }
  50%      { transform: scale(1.04); opacity: 1; }
}

/* ---- Capsule ---- */
.t-capsule {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-4);
  background: rgba(255,255,255,.72);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: var(--font-medium);
  color: var(--text-secondary);
  cursor: pointer;
  transition: border-color var(--duration-fast) var(--ease-standard),
              color var(--duration-fast) var(--ease-standard);
}

.t-capsule:hover {
  border-color: var(--border-hover);
  color: var(--text-primary);
}

.t-capsule__badge {
  padding: 1px 6px;
  border-radius: var(--radius-pill);
  background: #EFF4FF;
  font-size: var(--text-xs);
  color: var(--color-brand-primary);
}

/* ---- Progress ---- */
.t-progress {
  position: fixed;
  bottom: var(--space-5);
  right: var(--space-5);
  z-index: var(--z-dropdown);
  background: var(--color-bg-800);
  border: 1px solid var(--border-default);
  border-radius: var(--radius-lg);
  padding: var(--space-3) var(--space-4);
  font-size: var(--text-sm);
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 180px;
}

.t-progress__label {
  font-weight: var(--font-semibold);
  color: var(--text-primary);
}

.t-progress__bar {
  flex: 1;
  height: 4px;
  border-radius: 2px;
  background: var(--surface-3);
  overflow: hidden;
}

.t-progress__fill {
  height: 100%;
  border-radius: 2px;
  background: var(--color-brand-primary);
  transition: width var(--duration-grow) var(--ease-emphasized);
}

.t-progress__pct {
  font-weight: var(--font-semibold);
  color: var(--color-brand-primary);
  min-width: 36px;
  text-align: right;
}

/* ---- Toast ---- */
.t-toast-root {
  position: fixed;
  top: calc(var(--header-height) + var(--space-4));
  left: 50%;
  transform: translateX(-50%);
  z-index: var(--z-toast);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  pointer-events: none;
}

.t-toast {
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-pill);
  background: rgba(17,24,39,.94);
  border: 1px solid var(--border-default);
  font-size: var(--text-sm);
  color: #FFFFFF;
  animation: toast-in var(--duration-slow) var(--ease-standard),
             toast-out var(--duration-normal) 2.5s var(--ease-standard) forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-8px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes toast-out {
  to { opacity: 0; transform: translateY(-8px); }
}
