/*
 * furniture-depreciation-calculator.css
 *
 * Styles for [ash_furniture_depreciation_calculator] shortcode.
 * Scoped to .ash-calc-* class namespace.
 * Depends on ash-tokens.css — no hardcoded hex values.
 * Local --calc-* aliases bridge to shared tokens.
 * No private :root block.
 *
 * This content renders inside .ash-article-body, which already provides:
 *   - Base font, line-height, color
 *   - Serif h1/h2/h3 at weight 500
 *   - .ash-article-faq and .ash-article-resources styles
 */

/* ── Lead + disclaimer ───────────────────────────────────────────────────── */

.ash-calc-lead {
  font-size: 1.0625rem;
  color: var(--foreground);
  margin: 0 0 6px;
  line-height: 1.6;
}

.ash-calc-disclaimer-top {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin: 0 0 28px;
}

/* ── Calculator tool card ────────────────────────────────────────────────── */

.ash-calc-tool {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  overflow: hidden;
  margin: 32px 0 40px;
  box-shadow: var(--shadow-whisper);
}

/* ── Form ────────────────────────────────────────────────────────────────── */

.ash-calc-form {
  padding: 24px 24px 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ash-calc-fields-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

@media (max-width: 540px) {
  .ash-calc-fields-row {
    grid-template-columns: 1fr;
  }
}

.ash-calc-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ash-calc-label {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--foreground);
  margin: 0;
}

.ash-calc-field-help {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.4;
}

.ash-calc-input,
.ash-calc-select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  color: var(--foreground);
  font-size: 0.9375rem;
  font-family: var(--font-sans);
  line-height: 1.4;
  outline: none;
  transition: border-color 0.15s, box-shadow 0.15s;
  appearance: none;
  -webkit-appearance: none;
}

.ash-calc-input::placeholder {
  color: var(--muted-foreground);
}

.ash-calc-input:focus,
.ash-calc-select:focus {
  border-color: var(--ash-ring);
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.15);
}

.ash-calc-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%237a7568' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 32px;
  cursor: pointer;
}

/* Range slider */

.ash-calc-range-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
}

.ash-calc-range-value {
  font-size: 0.875rem;
  font-weight: 700;
  color: var(--ash-ring);
  min-width: 64px;
  text-align: right;
}

.ash-calc-range {
  width: 100%;
  margin: 6px 0 4px;
  accent-color: var(--ash-ring);
  cursor: pointer;
}

.ash-calc-range:focus {
  outline: none;
}

.ash-calc-range:focus-visible {
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.15);
  border-radius: 2px;
}

.ash-calc-range-ticks {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin-top: 2px;
}

/* ── Result region ───────────────────────────────────────────────────────── */

.ash-calc-result {
  padding: 24px;
  border-top: 1px solid var(--border);
  margin-top: 24px;
}

/* Empty state */

.ash-calc-result__empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 32px 0;
  text-align: center;
}

.ash-calc-result__empty-icon {
  color: var(--muted-foreground);
  flex-shrink: 0;
}

.ash-calc-result__empty-text {
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  margin: 0;
}

/* Result output */

.ash-calc-result__eyebrow {
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

/* Three-tier price display */

.ash-calc-tiers {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 10px;
  margin-bottom: 16px;
}

@media (max-width: 480px) {
  .ash-calc-tiers {
    grid-template-columns: 1fr;
  }
}

.ash-calc-tier {
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--background);
  padding: 14px 12px;
  text-align: center;
}

.ash-calc-tier--featured {
  border-color: var(--ash-ring);
  background: var(--ash-ring-tint);
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.10);
}

.ash-calc-tier__label {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  margin: 0 0 6px;
}

.ash-calc-tier--featured .ash-calc-tier__label {
  color: var(--ash-ring);
}

.ash-calc-tier__price {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--foreground);
  margin: 0 0 4px;
  line-height: 1.1;
  font-variant-numeric: tabular-nums;
}

.ash-calc-tier__note {
  font-size: 0.75rem;
  color: var(--muted-foreground);
  margin: 0;
  line-height: 1.3;
}

.ash-calc-result__fine {
  font-size: 0.8125rem;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

/* Result actions row */

.ash-calc-result__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

/* ── Button system ───────────────────────────────────────────────────────── */

.ash-calc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--radius-lg);
  font-size: 0.9rem;
  font-weight: 700;
  font-family: var(--font-sans);
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  border: 1px solid transparent;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  white-space: nowrap;
}

.ash-calc-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(201, 100, 66, 0.25);
}

.ash-calc-btn--primary {
  background: var(--ash-ring);
  border-color: var(--ash-ring);
  color: #fff;
}

.ash-calc-btn--primary:hover {
  background: var(--chart-1);
  border-color: var(--chart-1);
  color: #fff;
}

.ash-calc-btn--secondary {
  background: var(--foreground);
  border-color: var(--foreground);
  color: #fff;
}

.ash-calc-btn--secondary:hover {
  background: var(--ash-near-black);
  border-color: var(--ash-near-black);
  color: #fff;
}

.ash-calc-btn--ghost {
  background: var(--background);
  border-color: var(--border);
  color: var(--foreground);
}

.ash-calc-btn--ghost:hover {
  border-color: var(--ash-ring);
  color: var(--ash-ring);
}

/* ── Create-listing bridge ───────────────────────────────────────────────── */

.ash-calc-bridge {
  background: var(--ash-ring-tint);
  border: 1px solid rgba(201, 100, 66, 0.18);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.ash-calc-bridge__hed {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: 1.0625rem;
  color: var(--foreground);
  margin: 0 0 4px;
}

.ash-calc-bridge__sub {
  font-size: 0.875rem;
  color: var(--muted-foreground);
  margin: 0 0 16px;
}

.ash-calc-bridge__btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

/* ── Factors table ───────────────────────────────────────────────────────── */

.ash-calc-factors-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.875rem;
  margin: 20px 0 36px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.ash-calc-factors-table th {
  text-align: left;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted-foreground);
  background: var(--muted);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
}

.ash-calc-factors-table td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--border);
  color: var(--foreground);
  vertical-align: top;
}

.ash-calc-factors-table tr:last-child td {
  border-bottom: none;
}

.ash-calc-factors-table td:first-child {
  color: var(--ash-success);
  font-weight: 500;
}

.ash-calc-factors-table td:last-child {
  color: var(--ash-danger);
}

/* ── Why list section ────────────────────────────────────────────────────── */

.ash-calc-why-list {
  margin: 8px 0 32px 20px;
  padding: 0;
}

.ash-calc-why-list li {
  margin: 6px 0;
  color: var(--foreground);
  font-size: 0.9375rem;
  line-height: 1.55;
}

/* ── CTA band ────────────────────────────────────────────────────────────── */

.ash-calc-cta-band {
  background: var(--ash-near-black);
  border-radius: var(--radius-xl);
  padding: 32px 28px;
  margin: 36px 0;
  text-align: center;
}

.ash-calc-cta-band__hed {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(1.125rem, 2vw, 1.375rem);
  color: var(--background);
  margin: 0 0 20px;
  line-height: 1.35;
  text-wrap: balance;
}

.ash-calc-cta-band__btns {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

/* ── Toast notification ──────────────────────────────────────────────────── */

.ash-calc-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%) translateY(8px);
  background: var(--ash-near-black);
  color: var(--background);
  font-size: 0.875rem;
  font-weight: 600;
  padding: 10px 20px;
  border-radius: var(--radius-full);
  box-shadow: var(--shadow-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
  z-index: 9999;
  white-space: nowrap;
}

.ash-calc-toast.is-visible {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ── Reduced motion ──────────────────────────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  .ash-calc-btn,
  .ash-calc-input,
  .ash-calc-select,
  .ash-calc-toast {
    transition: none;
  }
}
