@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700;800&display=swap');

.shf-sim {
  --shf-primary: #0b659d;
  --shf-primary-hover: #095686;
  --shf-on-primary: #ffffff;
  --shf-bg: #fefdfb;
  --shf-card: #ffffff;
  --shf-text: #0f1729;
  --shf-muted: #435670;
  --shf-border: #dfe5ec;
  --shf-accent: #e5f3fa;
  --shf-success: #21c45d;
  --shf-danger: #dd2727;
  --shf-radius: 8px;
  --shf-font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
}

body.shf-sim-locked {
  overflow: hidden;
}

.shf-sim-overlay {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding: 16px;
  background: rgba(15, 23, 41, 0.55);
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
  overflow-y: auto;
  font-family: var(--shf-font);
  line-height: 1.5;
  box-sizing: border-box;
}

.shf-sim-overlay.shf-sim-open {
  display: flex;
}

.shf-sim-overlay *,
.shf-sim-overlay *::before,
.shf-sim-overlay *::after {
  box-sizing: border-box;
}

.shf-sim-dialog {
  position: relative;
  width: 100%;
  max-width: 520px;
  margin: auto;
  background: var(--shf-card);
  color: var(--shf-text);
  border-radius: calc(var(--shf-radius) * 1.5);
  box-shadow: 0 24px 60px rgba(15, 23, 41, 0.35);
  padding: 24px 20px 20px;
  animation: shf-sim-in 0.18s ease-out;
}

@keyframes shf-sim-in {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.shf-sim-overlay .shf-sim-close {
  position: absolute;
  top: 10px;
  right: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 0 !important;
  min-height: 0 !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background: none !important;
  box-shadow: none !important;
  -webkit-appearance: none !important;
  appearance: none !important;
  color: var(--shf-muted);
  font-family: var(--shf-font);
  font-size: 26px;
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  text-transform: none;
  text-shadow: none;
  cursor: pointer;
  border-radius: var(--shf-radius);
  transition: color 0.15s ease, background-color 0.15s ease;
}

.shf-sim-overlay .shf-sim-close:hover {
  background: var(--shf-accent) !important;
  color: var(--shf-text);
}

.shf-sim-title {
  margin: 0 36px 4px 0;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--shf-text);
}

.shf-sim-subtitle {
  margin: 0 0 18px;
  font-size: 13px;
  color: var(--shf-muted);
}

.shf-sim-body {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.shf-sim-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.shf-sim-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  font-size: 14px;
  font-weight: 500;
  color: var(--shf-text);
}

.shf-sim-value {
  font-size: 16px;
  font-weight: 700;
  color: var(--shf-primary);
  font-variant-numeric: tabular-nums;
}

.shf-sim-num-wrap {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.shf-sim-num {
  width: 92px;
  height: 38px;
  padding: 0 8px;
  text-align: right;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  color: var(--shf-primary);
  background: var(--shf-card);
  border: 1px solid var(--shf-border);
  border-radius: var(--shf-radius);
  font-variant-numeric: tabular-nums;
}

.shf-sim-num:focus-visible {
  outline: 2px solid var(--shf-primary);
  outline-offset: 2px;
}

.shf-sim-unit {
  font-size: 14px;
  font-weight: 600;
  color: var(--shf-muted);
  min-width: 32px;
}

.shf-sim-months {
  font-size: 12px;
  font-weight: 400;
  color: var(--shf-muted);
}

.shf-sim-bounds {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--shf-muted);
  font-variant-numeric: tabular-nums;
}

.shf-sim-range {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: var(--shf-accent);
  outline: none;
}

.shf-sim-range::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--shf-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 41, 0.35);
  cursor: pointer;
}

.shf-sim-range::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--shf-primary);
  border: 3px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 41, 0.35);
  cursor: pointer;
}

.shf-sim-select,
.shf-sim-input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  font-size: 15px;
  font-family: inherit;
  color: var(--shf-text);
  background: var(--shf-card);
  border: 1px solid var(--shf-border);
  border-radius: var(--shf-radius);
}

.shf-sim-select:focus-visible,
.shf-sim-input:focus-visible,
.shf-sim-range:focus-visible,
.shf-sim-btn:focus-visible,
.shf-sim-close:focus-visible {
  outline: 2px solid var(--shf-primary);
  outline-offset: 2px;
}

.shf-sim-result {
  text-align: center;
  padding: 18px 16px;
  background: var(--shf-accent);
  border: 1px solid var(--shf-primary);
  border-radius: var(--shf-radius);
}

.shf-sim-result-label {
  margin: 0 0 6px;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--shf-muted);
}

.shf-sim-monthly {
  margin: 0;
  font-size: 38px;
  font-weight: 800;
  color: var(--shf-primary);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}

.shf-sim-per {
  font-size: 15px;
  font-weight: 500;
  color: var(--shf-muted);
  margin-left: 4px;
}

.shf-sim-total {
  margin: 8px 0 0;
  font-size: 12px;
  color: var(--shf-muted);
}

.shf-sim-total strong {
  color: var(--shf-text);
  font-variant-numeric: tabular-nums;
}

.shf-sim-actions {
  display: flex;
  flex-direction: column-reverse;
  gap: 10px;
  margin-top: 4px;
}

.shf-sim-btn {
  width: 100%;
  height: 48px;
  font-size: 15px;
  font-weight: 700;
  font-family: inherit;
  border-radius: var(--shf-radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background-color 0.15s ease, opacity 0.15s ease;
}

.shf-sim-btn-primary {
  background: var(--shf-primary);
  color: var(--shf-on-primary);
}

.shf-sim-btn-primary:hover {
  background: var(--shf-primary-hover);
}

.shf-sim-btn-primary:disabled {
  opacity: 0.6;
  cursor: progress;
}

.shf-sim-btn-ghost {
  background: transparent;
  color: var(--shf-text);
  border-color: var(--shf-border);
}

.shf-sim-btn-ghost:hover {
  background: var(--shf-accent);
}

.shf-sim-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.shf-sim-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px;
}

.shf-sim-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  color: var(--shf-muted);
  cursor: pointer;
}

.shf-sim-consent a {
  color: var(--shf-primary);
  text-decoration: underline;
}

.shf-sim-check {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  flex: 0 0 auto;
  accent-color: var(--shf-primary);
}

.shf-sim-hp-wrap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.shf-sim-error {
  margin: 0;
  min-height: 0;
  color: var(--shf-danger);
  font-size: 13px;
  font-weight: 600;
}

.shf-sim-error:empty {
  display: none;
}

.shf-sim-success {
  text-align: center;
  padding: 8px 0 4px;
}

.shf-sim-success-icon {
  width: 56px;
  height: 56px;
  margin: 0 auto 14px;
  border-radius: 50%;
  background: var(--shf-success);
  color: #fff;
  font-size: 30px;
  line-height: 56px;
}

.shf-sim-success-text {
  margin: 0;
  font-size: 15px;
  color: var(--shf-text);
}

@media (min-width: 520px) {
  .shf-sim-dialog {
    padding: 28px 28px 24px;
  }
  .shf-sim-grid {
    grid-template-columns: 1fr 1fr;
  }
  .shf-sim-actions {
    flex-direction: row;
    justify-content: flex-end;
  }
  .shf-sim-btn {
    width: auto;
    min-width: 150px;
    padding: 0 22px;
  }
}
