/* ============================================================
   ScaleRetain — Component styles
   Class-based styles for the React primitives. Shipped to
   consumers via styles.css. Components stay thin (className only).
   ============================================================ */

/* ---------- Button ---------- */
.sr-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.55em;
  height: var(--control-h-md); padding: 0 1.25rem;
  font-family: var(--font-sans); font-size: var(--fs-label-size, 0.95rem);
  font-weight: var(--fw-medium); letter-spacing: -0.01em; line-height: 1;
  border: 1px solid transparent; border-radius: var(--r-md);
  cursor: pointer; white-space: nowrap; user-select: none;
  text-decoration: none; position: relative;
  transition: transform var(--dur-fast) var(--ease-out),
              box-shadow var(--dur-med) var(--ease-out),
              background var(--dur-med) var(--ease-out),
              border-color var(--dur-med) var(--ease-out),
              color var(--dur-med) var(--ease-out);
}
.sr-btn:focus-visible { outline: none; box-shadow: var(--ring-accent); }
.sr-btn:disabled, .sr-btn[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

.sr-btn--primary {
  background: var(--grad-blue-btn); color: var(--text-on-accent);
  font-weight: var(--fw-semibold);
  box-shadow: var(--glow-blue-sm);
}
.sr-btn--primary:hover { transform: translateY(-1px); box-shadow: var(--glow-blue-md); filter: brightness(1.04); }
.sr-btn--primary:active { transform: translateY(0); box-shadow: var(--glow-blue-sm); filter: brightness(0.98); }

.sr-btn--secondary {
  background: var(--surface-card); color: var(--text-primary);
  border-color: var(--border-default);
}
.sr-btn--secondary:hover { background: var(--surface-card-hover); border-color: var(--border-strong); transform: translateY(-1px); }
.sr-btn--secondary:active { transform: translateY(0); background: var(--surface-card); }

.sr-btn--ghost { background: transparent; color: var(--text-secondary); }
.sr-btn--ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.05); }

.sr-btn--sm { height: var(--control-h-sm); font-size: 0.85rem; padding: 0 0.9rem; border-radius: var(--r-sm); }
.sr-btn--lg { height: var(--control-h-lg); font-size: 1.0625rem; padding: 0 1.6rem; border-radius: var(--r-md); }
.sr-btn--block { display: flex; width: 100%; }

/* IconButton */
.sr-iconbtn {
  display: inline-flex; align-items: center; justify-content: center;
  width: var(--control-h-md); height: var(--control-h-md); padding: 0;
  border-radius: var(--r-full); border: 1px solid var(--border-default);
  background: var(--surface-card); color: var(--text-primary);
  cursor: pointer; transition: var(--transition-base);
}
.sr-iconbtn:hover { background: var(--surface-card-hover); border-color: var(--border-strong); }
.sr-iconbtn:focus-visible { outline: none; box-shadow: var(--ring-accent); }
.sr-iconbtn--sm { width: var(--control-h-sm); height: var(--control-h-sm); }
.sr-iconbtn--lg { width: var(--control-h-lg); height: var(--control-h-lg); }
.sr-iconbtn--ghost { background: transparent; border-color: transparent; color: var(--text-secondary); }
.sr-iconbtn--ghost:hover { color: var(--text-primary); background: rgba(255,255,255,0.06); }
.sr-iconbtn--accent { background: var(--grad-blue-btn); color: var(--text-on-accent); border-color: transparent; box-shadow: var(--glow-blue-sm); }

/* ---------- Badge ---------- */
.sr-badge {
  display: inline-flex; align-items: center; gap: 0.4em;
  font-family: var(--font-mono); font-size: 0.72rem; font-weight: var(--fw-medium);
  letter-spacing: 0.06em; line-height: 1;
  padding: 0.42em 0.78em; border-radius: var(--r-full);
  border: 1px solid var(--border-default); background: var(--surface-card);
  color: var(--text-secondary); white-space: nowrap;
}
.sr-badge--accent { background: var(--accent-soft); border-color: var(--accent-ring); color: var(--sr-blue-200); }
.sr-badge--outline { background: transparent; }
.sr-badge--solid { background: var(--grad-blue-btn); border-color: transparent; color: var(--text-on-accent); }
.sr-badge--success { background: rgba(52,211,153,0.12); border-color: rgba(52,211,153,0.35); color: #6ee7b7; }
.sr-badge .sr-badge__dot { width: 6px; height: 6px; border-radius: var(--r-full); background: currentColor; }

/* ---------- Card ---------- */
.sr-card {
  position: relative;
  background: var(--surface-card);
  border: 1px solid var(--border-default);
  border-radius: var(--r-xl);
  padding: var(--sp-5);
  box-shadow: var(--shadow-card);
}
.sr-card::before {
  content: ""; position: absolute; inset: 0; border-radius: inherit;
  background: var(--grad-card-sheen); pointer-events: none;
}
.sr-card > * { position: relative; }
.sr-card--interactive { cursor: pointer; transition: var(--transition-base); }
.sr-card--interactive:hover { background: var(--surface-card-hover); border-color: var(--border-strong); transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.sr-card--flush { padding: 0; overflow: hidden; }
.sr-card--glow { box-shadow: var(--shadow-card); border-color: var(--accent-ring); }
.sr-card--glow::after {
  content: ""; position: absolute; inset: -1px; border-radius: inherit; z-index: -1;
  background: radial-gradient(60% 120% at 50% 0%, rgba(16,160,255,0.22), transparent 70%);
}

/* ---------- Avatar ---------- */
.sr-avatar {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; border-radius: var(--r-full);
  background: var(--surface-card-hover); color: var(--text-primary);
  font-family: var(--font-sans); font-weight: var(--fw-semibold); font-size: 0.9rem;
  overflow: hidden; flex: none; border: 1.5px solid var(--surface-canvas);
  box-shadow: 0 0 0 1px var(--border-default);
}
.sr-avatar img { width: 100%; height: 100%; object-fit: cover; }
.sr-avatar--sm { width: 28px; height: 28px; font-size: 0.72rem; }
.sr-avatar--lg { width: 56px; height: 56px; font-size: 1.1rem; }
.sr-avatar-stack { display: inline-flex; }
.sr-avatar-stack > .sr-avatar + .sr-avatar { margin-left: -12px; }

/* ---------- FeatureCard ---------- */
.sr-feature { display: flex; flex-direction: column; gap: var(--sp-3); text-align: center; align-items: center; }
.sr-feature__icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 52px; height: 52px; color: var(--accent);
}
.sr-feature__icon svg { width: 30px; height: 30px; }
.sr-feature__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-primary); }
.sr-feature__body { font-size: var(--fs-base); line-height: var(--lh-relaxed); color: var(--text-muted); max-width: 34ch; }

/* ---------- ProcessStep ---------- */
.sr-step { padding: var(--sp-6); transition: var(--transition-base); }
.sr-step__num { font-family: var(--font-mono); font-size: 2.25rem; font-weight: var(--fw-medium); line-height: 1; color: var(--accent); margin-bottom: var(--sp-5); }
.sr-step__title { font-size: var(--fs-lg); font-weight: var(--fw-semibold); color: var(--text-primary); margin-bottom: var(--sp-2); }
.sr-step__body { font-size: var(--fs-base); line-height: var(--lh-relaxed); color: var(--text-muted); max-width: 52ch; }
.sr-step--dim { opacity: 0.42; }
.sr-step--dim .sr-step__num { color: var(--text-disabled); }

/* ---------- FaqItem ---------- */
.sr-faq { border: 1px solid var(--border-default); border-radius: var(--r-lg); background: var(--surface-card); overflow: hidden; transition: border-color var(--dur-med) var(--ease-out), background var(--dur-med) var(--ease-out); }
.sr-faq + .sr-faq { margin-top: var(--sp-3); }
.sr-faq[data-open="true"] { background: var(--surface-card-hover); border-color: var(--border-strong); }
.sr-faq__q {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4);
  width: 100%; text-align: left; background: none; border: none; cursor: pointer;
  padding: var(--sp-5); font-family: var(--font-sans); font-size: var(--fs-md);
  font-weight: var(--fw-medium); color: var(--text-primary);
}
.sr-faq__q:focus-visible { outline: none; box-shadow: var(--ring-accent); border-radius: var(--r-md); }
.sr-faq__icon { flex: none; width: 22px; height: 22px; position: relative; color: var(--text-muted); transition: transform var(--dur-med) var(--ease-out), color var(--dur-med) var(--ease-out); }
.sr-faq[data-open="true"] .sr-faq__icon { transform: rotate(45deg); color: var(--accent); }
.sr-faq__panel { display: grid; grid-template-rows: 0fr; transition: grid-template-rows var(--dur-slow) var(--ease-out); }
.sr-faq[data-open="true"] .sr-faq__panel { grid-template-rows: 1fr; }
.sr-faq__panel > div { overflow: hidden; }
.sr-faq__a { padding: 0 var(--sp-5) var(--sp-5); font-size: var(--fs-base); line-height: var(--lh-relaxed); color: var(--text-secondary); max-width: 60ch; }

/* ---------- StarRating ---------- */
.sr-stars { display: inline-flex; gap: 2px; color: var(--sr-warning); }
.sr-stars svg { width: 1em; height: 1em; }
.sr-stars--muted { color: var(--text-disabled); }

/* ---------- Input ---------- */
.sr-field { display: flex; flex-direction: column; gap: var(--sp-2); }
.sr-field__label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-secondary); }
.sr-input {
  height: var(--control-h-md); padding: 0 var(--sp-4);
  font-family: var(--font-sans); font-size: var(--fs-base); color: var(--text-primary);
  background: var(--surface-input); border: 1px solid var(--border-default);
  border-radius: var(--r-md); width: 100%; transition: var(--transition-base);
}
.sr-input::placeholder { color: var(--text-disabled); }
.sr-input:hover { border-color: var(--border-strong); }
.sr-input:focus { outline: none; border-color: var(--accent); box-shadow: var(--ring-accent); }
.sr-input--lg { height: var(--control-h-lg); font-size: var(--fs-md); }
textarea.sr-input { height: auto; padding: var(--sp-3) var(--sp-4); resize: vertical; line-height: var(--lh-normal); }
.sr-field__hint { font-size: var(--fs-xs); color: var(--text-muted); }
.sr-field--error .sr-input { border-color: var(--sr-danger); }
.sr-field--error .sr-field__hint { color: var(--sr-danger); }
