/* ==========================================================================
   PixelWorks Calculators - Shared Base CSS
   Scoped under .pw-calc to prevent style leaking in/out.
   No !important used anywhere.
   ========================================================================== */

/* ---------------------------------------------------------------------------
   CSS Custom Properties
   --------------------------------------------------------------------------- */

.pw-calc {
  --pw-primary: #2563eb;
  --pw-primary-hover: #1d4ed8;
  --pw-text: #1f2937;
  --pw-text-light: #6b7280;
  --pw-bg: #ffffff;
  --pw-bg-card: #ffffff;
  --pw-border: #e5e7eb;
  --pw-border-focus: #2563eb;
  --pw-danger: #ef4444;
  --pw-success: #10b981;
  --pw-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --pw-font-mono: 'SF Mono', Monaco, 'Cascadia Code', monospace;
  --pw-radius: 8px;
  --pw-radius-sm: 4px;
  --pw-shadow: 0 1px 3px rgba(0,0,0,0.1);
  --pw-shadow-md: 0 4px 6px rgba(0,0,0,0.07);
}

/* ---------------------------------------------------------------------------
   Light CSS Reset
   --------------------------------------------------------------------------- */

.pw-calc,
.pw-calc *,
.pw-calc *::before,
.pw-calc *::after {
  box-sizing: border-box;
}

.pw-calc {
  font-family: var(--pw-font);
  color: var(--pw-text);
  line-height: 1.5;
  margin: 0 auto;
  -webkit-font-smoothing: antialiased;
}

/* ---------------------------------------------------------------------------
   Card Component
   --------------------------------------------------------------------------- */

.pw-calc .pw-card {
  background: var(--pw-bg-card);
  border: 1px solid var(--pw-border);
  border-radius: var(--pw-radius);
  padding: 24px;
  margin-bottom: 16px;
  box-shadow: var(--pw-shadow);
}

/* ---------------------------------------------------------------------------
   Form Elements
   --------------------------------------------------------------------------- */

/* Text, number inputs and selects */

.pw-calc input[type="text"],
.pw-calc input[type="number"],
.pw-calc input[type="email"],
.pw-calc input[type="tel"],
.pw-calc input[type="url"],
.pw-calc select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--pw-border);
  border-radius: var(--pw-radius-sm);
  font-size: 15px;
  color: var(--pw-text);
  background: var(--pw-bg);
  transition: border-color 0.2s;
}

.pw-calc input[type="text"]:focus,
.pw-calc input[type="number"]:focus,
.pw-calc input[type="email"]:focus,
.pw-calc input[type="tel"]:focus,
.pw-calc input[type="url"]:focus,
.pw-calc select:focus {
  border-color: var(--pw-border-focus);
  outline: none;
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}

/* Labels */

.pw-calc label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--pw-text);
  margin-bottom: 6px;
}

/* Checkbox labels */

.pw-calc .pw-checkbox-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
}

/* Checkbox input */

.pw-calc input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--pw-primary);
  cursor: pointer;
}

/* Range slider */

.pw-calc input[type="range"] {
  width: 100%;
  height: 6px;
  accent-color: var(--pw-primary);
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  background: var(--pw-border);
  border-radius: 3px;
}

.pw-calc input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pw-primary);
  border: 2px solid #ffffff;
  cursor: pointer;
}

.pw-calc input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--pw-primary);
  border: 2px solid #ffffff;
  cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Buttons
   --------------------------------------------------------------------------- */

.pw-calc .pw-btn {
  padding: 8px 16px;
  border-radius: var(--pw-radius-sm);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.pw-calc .pw-btn-primary {
  background: var(--pw-primary);
  color: #ffffff;
}

.pw-calc .pw-btn-primary:hover {
  background: var(--pw-primary-hover);
}

.pw-calc .pw-btn-outline {
  background: transparent;
  color: var(--pw-text);
  border: 1px solid var(--pw-border);
}

.pw-calc .pw-btn-outline:hover {
  background: #f9fafb;
}

.pw-calc .pw-link-btn {
  background: none;
  border: none;
  color: var(--pw-primary);
  cursor: pointer;
  font-size: 14px;
  padding: 0;
  text-decoration: none;
}

.pw-calc .pw-link-btn:hover {
  text-decoration: underline;
}

/* ---------------------------------------------------------------------------
   Typography
   --------------------------------------------------------------------------- */

.pw-calc h2 {
  font-size: 24px;
  font-weight: 600;
  margin: 0;
}

.pw-calc h3 {
  font-size: 16px;
  font-weight: 600;
  margin: 0;
}

.pw-calc .pw-helper {
  font-size: 13px;
  color: var(--pw-text-light);
  margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   Utilities
   --------------------------------------------------------------------------- */

.pw-calc .pw-hidden {
  display: none;
}

.pw-calc .pw-flex {
  display: flex;
}

.pw-calc .pw-flex-between {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.pw-calc .pw-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.pw-calc .pw-mt-8 {
  margin-top: 8px;
}

.pw-calc .pw-mt-16 {
  margin-top: 16px;
}

.pw-calc .pw-mb-8 {
  margin-bottom: 8px;
}
