@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&family=Poppins:wght@500;600;700&display=swap');

/* Resolv Flat — component styles. Values come from tokens.css; nothing here blurs, glows or gradients. */

.rv-root, .rv-btn, .rv-switch, .rv-check, .rv-field, .rv-tabs, .rv-card, .rv-badge {
  -webkit-font-smoothing: antialiased;
  box-sizing: border-box;
}
.rv-root *, .rv-btn *, .rv-switch *, .rv-check *, .rv-field *, .rv-tabs *, .rv-card *, .rv-badge * { box-sizing: border-box; }

/* ---------- Button ---------- */
.rv-btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: var(--space-2);
  min-height: 44px; padding: 0 var(--space-5);
  border: var(--stroke-control) solid transparent; border-radius: var(--radius-md);
  font-family: var(--font-display); font-size: 15px; line-height: 20px; font-weight: 600; letter-spacing: 0;
  text-decoration: none; white-space: nowrap; cursor: pointer; user-select: none;
  -webkit-tap-highlight-color: transparent;
  outline: var(--stroke-focus) solid transparent; outline-offset: 0;
  transform: scale(1);
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard),
    transform var(--duration-base) var(--ease-spring);
}
.rv-btn:active:not(:disabled) {
  transform: scale(var(--press-scale));
  transition:
    background-color var(--duration-instant) var(--ease-exit),
    transform var(--duration-instant) var(--ease-exit);
}
.rv-btn:focus-visible { outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }

.rv-btn--sm { min-height: 36px; padding: 0 var(--space-4); font-size: 14px; }
.rv-btn--lg { min-height: 52px; padding: 0 var(--space-6); font-size: 16px; }

.rv-btn--primary { background: var(--action); color: var(--on-action); }
.rv-btn--primary:hover:not(:disabled) { background: var(--action-hover); }
.rv-btn--primary:active:not(:disabled) { background: var(--action-press); }

.rv-btn--solid { background: var(--solid); color: var(--ink-inverse); }
.rv-btn--solid:hover:not(:disabled) { background: var(--solid-hover); }

.rv-btn--outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.rv-btn--outline:hover:not(:disabled) { border-color: var(--ink); background: var(--action-tint); }

.rv-btn--ghost { background: transparent; color: var(--ink-link); }
.rv-btn--ghost:hover:not(:disabled) { background: var(--action-tint); }

.rv-btn--danger { background: var(--danger); color: var(--on-danger); }
.rv-btn--danger:hover:not(:disabled) { background: var(--danger-ink); }

.rv-btn:disabled { background: var(--disabled-fill); color: var(--disabled-ink); border-color: transparent; cursor: not-allowed; }

.rv-btn__icon { display: inline-flex; width: 18px; height: 18px; align-items: center; justify-content: center; }
.rv-btn__icon svg { width: 18px; height: 18px; }
.rv-btn__arrow { display: inline-block; transition: transform var(--duration-base) var(--ease-standard); }
.rv-btn:hover:not(:disabled) .rv-btn__arrow { transform: translateX(3px); }

.rv-btn.is-loading .rv-btn__label { opacity: 0; }
.rv-spinner {
  position: absolute; width: 18px; height: 18px; border-radius: var(--radius-pill);
  border: 2px solid currentColor; border-right-color: transparent;
  animation: rv-spin 700ms linear infinite;
}
@keyframes rv-spin { to { transform: rotate(360deg); } }

/* ---------- Switch ---------- */
.rv-switch { display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-family: var(--font-sans); font-size: 15px; line-height: 20px; color: var(--ink); }
.rv-switch__track {
  position: relative; flex: none; width: 48px; height: 28px; padding: 0;
  border: var(--stroke-control) solid var(--line-strong); border-radius: var(--radius-pill);
  background: var(--surface-subtle); cursor: pointer;
  outline: var(--stroke-focus) solid transparent; outline-offset: 0;
  transition:
    background-color var(--duration-base) var(--ease-standard),
    border-color var(--duration-base) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard);
}
.rv-switch__track:focus-visible { outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }
.rv-switch__thumb {
  position: absolute; top: 3px; left: 3px; width: 19px; height: 19px; border-radius: var(--radius-pill);
  background: var(--line-strong);
  transition:
    transform var(--duration-base) var(--ease-spring),
    width var(--duration-instant) var(--ease-standard),
    background-color var(--duration-base) var(--ease-standard);
}
.rv-switch__track:active .rv-switch__thumb { width: 23px; }
.rv-switch__track[aria-checked="true"] { background: var(--action); border-color: var(--action); }
.rv-switch__track[aria-checked="true"] .rv-switch__thumb { transform: translateX(20px); background: var(--on-action); }
.rv-switch__track[aria-checked="true"]:active .rv-switch__thumb { transform: translateX(16px); }
.rv-switch--ai .rv-switch__track[aria-checked="true"] { background: var(--ai); border-color: var(--ai); }
.rv-switch--ai .rv-switch__track[aria-checked="true"] .rv-switch__thumb { background: var(--on-ai); }
.rv-switch.is-disabled { cursor: not-allowed; color: var(--disabled-ink); }
.rv-switch__track:disabled { background: var(--disabled-fill); border-color: var(--disabled-fill); cursor: not-allowed; }
.rv-switch__track:disabled .rv-switch__thumb { background: var(--disabled-ink); }

/* ---------- Checkbox ---------- */
.rv-check { position: relative; display: inline-flex; align-items: center; gap: var(--space-3); cursor: pointer; font-family: var(--font-sans); font-size: 15px; line-height: 20px; color: var(--ink); }
.rv-check__input { position: absolute; opacity: 0; width: 20px; height: 20px; margin: 0; cursor: pointer; }
.rv-check__box {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: var(--radius-sm);
  border: var(--stroke-control) solid var(--line-strong); background: var(--surface);
  outline: var(--stroke-focus) solid transparent; outline-offset: 0;
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard),
    transform var(--duration-base) var(--ease-spring);
}
.rv-check__box svg { width: 14px; height: 14px; }
.rv-check__box path {
  fill: none; stroke: var(--on-action); stroke-width: 2.25; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 16; stroke-dashoffset: 16;
  transition: stroke-dashoffset var(--duration-base) var(--ease-standard);
}
.rv-check:hover .rv-check__box { border-color: var(--ink); }
.rv-check:active .rv-check__box { transform: scale(0.9); transition: transform var(--duration-instant) var(--ease-exit); }
.rv-check__input:checked + .rv-check__box { background: var(--action); border-color: var(--action); }
.rv-check__input:checked + .rv-check__box path { stroke-dashoffset: 0; transition-delay: 40ms; }
.rv-check__input:focus-visible + .rv-check__box { outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }
.rv-check.is-disabled { cursor: not-allowed; color: var(--disabled-ink); }
.rv-check__input:disabled + .rv-check__box { background: var(--disabled-fill); border-color: var(--disabled-fill); }

/* ---------- TextField ---------- */
.rv-field { display: flex; flex-direction: column; gap: var(--space-2); font-family: var(--font-sans); width: 100%; max-width: 420px; }
.rv-field__label { font-size: 14px; line-height: 20px; font-weight: 500; color: var(--ink); }
.rv-field__control {
  width: 100%; min-height: 44px; padding: var(--space-3);
  font: inherit; font-size: 16px; line-height: 20px; color: var(--ink);
  background: var(--surface); border: var(--stroke-control) solid var(--line-strong); border-radius: var(--radius-md);
  outline: var(--stroke-focus) solid transparent; outline-offset: 0;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard);
}
.rv-field__control::placeholder { color: var(--ink-muted); }
.rv-field__control:hover { border-color: var(--ink); }
.rv-field__control:focus { border-color: var(--focus-ring); outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }
.rv-field__hint { font-size: 14px; line-height: 20px; color: var(--ink-muted); }
.rv-field.has-error .rv-field__control { border-color: var(--danger-ink); }
.rv-field.has-error .rv-field__hint { color: var(--danger-ink); animation: rv-hint-in var(--duration-base) var(--ease-enter); }
.rv-field__control:disabled { background: var(--disabled-fill); border-color: var(--disabled-fill); color: var(--disabled-ink); cursor: not-allowed; }
@keyframes rv-hint-in { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }

/* ---------- Tabs ---------- */
.rv-tabs { font-family: var(--font-display); }
.rv-tabs__list { position: relative; display: flex; gap: var(--space-1); border-bottom: var(--stroke-hairline) solid var(--line); overflow-x: auto; scrollbar-width: none; }
.rv-tabs__tab {
  position: relative; flex: none; min-height: 44px; padding: 0 var(--space-4);
  background: transparent; border: 0; border-radius: var(--radius-md) var(--radius-md) 0 0;
  font: inherit; font-size: 15px; line-height: 20px; font-weight: 500; color: var(--ink-muted); cursor: pointer;
  outline: var(--stroke-focus) solid transparent; outline-offset: -4px;
  transition: color var(--duration-fast) var(--ease-standard), background-color var(--duration-fast) var(--ease-standard), outline-color var(--duration-fast) var(--ease-standard);
}
.rv-tabs__tab:hover { color: var(--ink); background: var(--action-tint); }
.rv-tabs__tab[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.rv-tabs__tab:focus-visible { outline-color: var(--focus-ring); }
.rv-tabs__indicator {
  position: absolute; left: 0; bottom: -1px; height: 3px; border-radius: 3px 3px 0 0; background: var(--action);
  transition: transform var(--duration-base) var(--ease-standard), width var(--duration-base) var(--ease-standard);
}

/* ---------- Card ---------- */
.rv-card {
  display: block; width: 100%; text-align: left; color: var(--ink); font-family: var(--font-sans);
  padding: var(--space-5); border-radius: var(--radius-lg);
  background: var(--surface-raised); border: var(--stroke-hairline) solid var(--line);
}
.rv-card--subtle { background: var(--surface-subtle); border-color: transparent; }
.rv-card--inverse { background: var(--surface-inverse); color: var(--ink-inverse); border-color: transparent; }
.rv-card--interactive {
  cursor: pointer; font: inherit; font-family: var(--font-sans);
  outline: var(--stroke-focus) solid transparent; outline-offset: 0;
  transition:
    border-color var(--duration-fast) var(--ease-standard),
    background-color var(--duration-fast) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard),
    transform var(--duration-base) var(--ease-spring);
}
.rv-card--interactive:hover { border-color: var(--action); background: var(--action-tint); }
.rv-card--interactive:active { transform: scale(var(--press-scale-card)); transition: transform var(--duration-instant) var(--ease-exit); }
.rv-card--interactive:focus-visible { outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }
.rv-card__title { margin: 0 0 var(--space-2); font-family: var(--font-display); font-size: 18px; line-height: 26px; font-weight: 600; }
.rv-card__body { margin: 0; font-size: 15px; line-height: 22px; color: var(--ink-muted); }
.rv-card--inverse .rv-card__body { color: inherit; opacity: 1; }

/* ---------- Badge ---------- */
.rv-badge {
  display: inline-flex; align-items: center; gap: var(--space-1); height: 24px; padding: 0 10px;
  border-radius: var(--radius-pill); font-family: var(--font-sans); font-size: 12px; line-height: 16px; font-weight: 600; white-space: nowrap;
  background: var(--surface-subtle); color: var(--ink); border: var(--stroke-hairline) solid var(--line);
}
.rv-badge--info { background: var(--action); color: var(--on-action); border-color: transparent; }
.rv-badge--ai { background: var(--ai); color: var(--on-ai); border-color: transparent; }
.rv-badge--success { background: var(--success); color: var(--on-status); border-color: transparent; }
.rv-badge--warning { background: var(--warning); color: var(--on-status); border-color: transparent; }
.rv-badge--danger { background: var(--danger); color: var(--on-danger); border-color: transparent; }
.rv-badge__dot { width: 6px; height: 6px; border-radius: var(--radius-pill); background: currentColor; }
.rv-badge--live .rv-badge__dot { animation: rv-live 1600ms var(--ease-standard) infinite; }
@keyframes rv-live { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }

/* ---------- Brand marks and icons ---------- */
.rv-icon { display: inline-block; flex: none; vertical-align: middle; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.rv-icon__dot { fill: currentColor; stroke: none; }

.rv-tile { display: inline-flex; flex: none; align-items: center; justify-content: center; border-radius: 25%; box-sizing: border-box; }
.rv-tile--solution { background: var(--surface-tint); color: var(--ink); }
.rv-tile--solution .rv-icon__dot { fill: var(--ink-link); }

.rv-si { display: inline-flex; align-items: center; color: var(--ink); line-height: 1; vertical-align: middle; }
.rv-si__mark { display: block; flex: none; }
.rv-si__ring { fill: none; stroke: var(--ink); stroke-width: 9; }
.rv-si__dot { fill: var(--ink-link); stroke: none; }
.rv-si__words { display: flex; flex-direction: column; gap: 2px; }
.rv-si__eyebrow { font-family: var(--font-display); font-weight: 600; line-height: 1.25; letter-spacing: 0.32em; color: var(--ink-link); }
.rv-si__name { font-family: var(--font-display); font-weight: 700; line-height: 1.15; letter-spacing: -0.015em; color: var(--ink); white-space: nowrap; }

.rv-ptile { display: inline-block; flex: none; vertical-align: middle; }
.rv-ptile--gig .rv-ptile__bg { stroke: var(--line); stroke-width: 1; }
[data-theme="dark"] .rv-ptile--resolvers .rv-ptile__bg { stroke: var(--line); stroke-width: 2; }

.rv-itile { display: inline-block; flex: none; vertical-align: middle; }
.rv-itile__bg { stroke: var(--brand-ice); stroke-width: 1; }

/* ---------- Reduced motion ---------- */
/* ---------- Theme toggle (icon button): Light / Dark. Builds open in Light. ---------- */
.rv-themebtn {
  position: relative; display: inline-grid; place-items: center; flex: none; box-sizing: border-box;
  width: 36px; height: 36px; padding: 0;
  border: var(--stroke-control) solid var(--line-strong); border-radius: var(--radius-md);
  background: transparent; color: var(--ink); cursor: pointer; -webkit-tap-highlight-color: transparent;
  outline: var(--stroke-focus) solid transparent; outline-offset: 0; transform: scale(1);
  transition:
    background-color var(--duration-fast) var(--ease-standard),
    border-color var(--duration-fast) var(--ease-standard),
    color var(--duration-fast) var(--ease-standard),
    outline-color var(--duration-fast) var(--ease-standard),
    outline-offset var(--duration-fast) var(--ease-standard),
    transform var(--duration-base) var(--ease-spring);
}
.rv-themebtn--md { width: 44px; height: 44px; }
.rv-themebtn:hover { background: var(--action-tint); border-color: var(--ink); }
.rv-themebtn:active {
  transform: scale(var(--press-scale));
  transition: background-color var(--duration-instant) var(--ease-exit), transform var(--duration-instant) var(--ease-exit);
}
.rv-themebtn:focus-visible { outline-color: var(--focus-ring); outline-offset: var(--focus-offset); }
.rv-themebtn__glyph { display: inline-grid; place-items: center; animation: rv-theme-in var(--duration-base) var(--ease-spring); }
@keyframes rv-theme-in { from { transform: rotate(-60deg) scale(0.6); opacity: 0; } to { transform: none; opacity: 1; } }

@media (prefers-reduced-motion: reduce) {
  .rv-btn, .rv-btn:active, .rv-check__box, .rv-card--interactive, .rv-themebtn, .rv-themebtn:active {
    transition-property: background-color, border-color, color, outline-color !important;
  }
  .rv-switch__thumb, .rv-check__box path, .rv-tabs__indicator, .rv-btn__arrow { transition-duration: 1ms !important; }
  .rv-btn:active:not(:disabled), .rv-card--interactive:active, .rv-check:active .rv-check__box, .rv-themebtn:active { transform: none; }
  .rv-field.has-error .rv-field__hint, .rv-badge--live .rv-badge__dot, .rv-themebtn__glyph { animation: none; }
  .rv-spinner { animation-duration: 1400ms; }
}
