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

/* ============================================================
   Smart Cost Calculator Pro — Frontend
   ============================================================ */
:root {
  --scc-red:      #e63946;
  --scc-red-dk:   #c1121f;
  --scc-bg:       #ffffff;
  --scc-bg2:      #f8f9fa;
  --scc-border:   #e0e0e0;
  --scc-text:     #1a1a1a;
  --scc-muted:    #6b7280;
  --scc-radius:   10px;
  --scc-shadow:   0 1px 4px rgba(0,0,0,0.08);
}

.scc-wrapper {
  display: flex;
  gap: 24px;
  max-width: 1080px;
  margin: 0 auto;
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  color: var(--scc-text);
  align-items: flex-start;
}

/* ======== LEFT ======== */
.scc-left { flex: 1.1; display: flex; flex-direction: column; gap: 14px; }

.scc-section {
  background: var(--scc-bg);
  border: 1px solid var(--scc-border);
  border-radius: var(--scc-radius);
  overflow: hidden;
  box-shadow: var(--scc-shadow);
}

.scc-section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 13px 18px;
  background: var(--scc-bg2);
  border-bottom: 1px solid var(--scc-border);
  cursor: pointer;
  user-select: none;
}

.scc-section-header h3 {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.07em;
  color: var(--scc-text);
}

.scc-toggle-icon {
  font-size: 18px;
  color: var(--scc-muted);
  transition: transform .25s;
  line-height: 1;
}
.scc-section.scc-collapsed .scc-toggle-icon  { transform: rotate(-90deg); }
.scc-section.scc-collapsed .scc-section-body { display: none; }

/* Quantity item */
.scc-qty-item {
  padding: 12px 18px;
  border-bottom: 1px solid var(--scc-border);
}
.scc-qty-item:last-child { border-bottom: none; }

.scc-qty-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

.scc-qty-info strong { display: block; font-size: 14px; font-weight: 600; }
.scc-price-hint      { font-size: 12px; color: var(--scc-muted); margin-top: 2px; display: block; }
.scc-max-note        { font-size: 11px; color: var(--scc-muted); margin: 4px 0 0; font-style: italic; }

.scc-qty-ctrl {
  display: flex;
  align-items: stretch;
  border: 1.5px solid var(--scc-border);
  border-radius: 7px;
  overflow: hidden;
  background: white;
}

.scc-minus, .scc-plus {
  background: var(--scc-bg2);
  border: none;
  width: 34px;
  font-size: 17px;
  font-weight: 600;
  cursor: pointer;
  color: var(--scc-text);
  transition: background .15s;
  flex-shrink: 0;
}
.scc-minus:hover:not(:disabled), .scc-plus:hover:not(:disabled) { background: #e9ecef; }
.scc-minus:disabled, .scc-plus:disabled { opacity: 0.35; cursor: not-allowed; }

.scc-qty-input {
  width: 48px;
  text-align: center;
  border: none;
  border-left: 1.5px solid var(--scc-border);
  border-right: 1.5px solid var(--scc-border);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  outline: none;
  padding: 0;
  background: white;
}
.scc-qty-input[readonly] { background: var(--scc-bg2); color: var(--scc-muted); cursor: default; }
/* hide spin arrows */
.scc-qty-input::-webkit-inner-spin-button,
.scc-qty-input::-webkit-outer-spin-button { -webkit-appearance: none; }
.scc-qty-input[type=number] { -moz-appearance: textfield; }

/* Checkbox item */
.scc-chk-item {
  padding: 10px 18px;
  border-bottom: 1px solid var(--scc-border);
  transition: background .15s;
}
.scc-chk-item:last-child { border-bottom: none; }
.scc-chk-item:hover { background: #fafafa; }

.scc-chk-label {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  width: 100%;
}
.scc-chk-label input[type=checkbox] { display: none; }

.scc-checkmark {
  width: 19px; height: 19px;
  border: 2px solid var(--scc-border);
  border-radius: 5px;
  flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  transition: all .15s;
  background: white;
}
.scc-chk-label input:checked ~ .scc-checkmark {
  background: var(--scc-red);
  border-color: var(--scc-red);
}
.scc-chk-label input:checked ~ .scc-checkmark::after {
  content: '';
  width: 5px; height: 9px;
  border: 2px solid white;
  border-top: none; border-left: none;
  transform: rotate(45deg) translateY(-1px);
  display: block;
}
.scc-chk-text  { flex: 1; font-size: 14px; }
.scc-chk-price { font-size: 13px; color: var(--scc-muted); font-weight: 500; margin-left: auto; }

/* ======== RIGHT ======== */
.scc-right { flex: 1; position: sticky; top: 28px; }

.scc-summary-card {
  background: var(--scc-bg);
  border: 1px solid var(--scc-border);
  border-radius: var(--scc-radius);
  box-shadow: var(--scc-shadow);
  overflow: hidden;
}

.scc-summary-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 15px 20px;
  background: var(--scc-bg2);
  border-bottom: 1px solid var(--scc-border);
}
.scc-summary-head h3 { margin: 0; font-size: 16px; font-weight: 700; }

/* Grouped summary table */
.scc-summary-table-wrap { padding: 0 20px; }

.scc-tbl-header {
  display: flex;
  justify-content: space-between;
  padding: 10px 0 7px;
  border-bottom: 1px solid var(--scc-border);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--scc-muted);
}

.scc-tbl-body { padding: 4px 0 8px; min-height: 50px; }
.scc-placeholder { color: var(--scc-muted); text-align: center; font-size: 13px; padding: 14px 0; }

/* Group block */
.scc-sum-group { margin-bottom: 10px; }
.scc-sum-group-header {
  display: flex; justify-content: space-between;
  font-weight: 700;
  font-size: 13px;
  padding: 6px 0 4px;
  border-bottom: 1px solid var(--scc-border);
  color: var(--scc-text);
}
.scc-sum-group-item {
  display: flex; justify-content: space-between;
  font-size: 12.5px;
  padding: 3px 0 3px 10px;
  color: var(--scc-muted);
}
.scc-sum-group-item span:last-child { color: var(--scc-text); font-weight: 500; }

/* Totals */
.scc-totals-box {
  padding: 14px 20px;
  background: var(--scc-bg2);
  border-top: 2px solid var(--scc-border);
}
.scc-total-upfront {
  display: flex; justify-content: space-between;
  font-size: 15px; font-weight: 700;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--scc-border);
}
.scc-total-future {
  display: flex; justify-content: space-between;
  font-size: 13px; color: var(--scc-muted);
  padding-top: 8px;
}
.scc-val-future { font-weight: 600; }

/* Payment section */
.scc-payment-section {
  padding: 14px 20px;
  border-top: 1px solid var(--scc-border);
}
.scc-pm-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: .06em; color: var(--scc-muted);
  margin: 0 0 10px;
}
.scc-stripe-badge {
  border: 1.5px solid var(--scc-border);
  border-radius: 7px;
  padding: 8px 14px;
  display: inline-flex;
  align-items: center;
  margin-bottom: 12px;
  background: white;
}

.scc-card-element {
  border: 1.5px solid var(--scc-border);
  border-radius: 7px;
  padding: 11px 12px;
  background: #fafafa;
  transition: border-color .2s;
}
.scc-card-element.StripeElement--focus { border-color: #635BFF; background: white; }
.scc-card-error { color: #dc3545; font-size: 12px; margin-top: 6px; min-height: 18px; }

.scc-no-stripe-warning {
  padding: 12px 20px;
  background: #fff3cd;
  border-top: 1px solid var(--scc-border);
  font-size: 13px;
  color: #856404;
}

/* Form */
.scc-form {
  padding: 16px 20px;
  border-top: 1px solid var(--scc-border);
  display: flex;
  flex-direction: column;
  gap: 11px;
}
.scc-field { display: flex; flex-direction: column; gap: 4px; }
.scc-field label { font-size: 13px; font-weight: 600; }
.scc-field label span { color: var(--scc-red); }

.scc-input {
  border: 1.5px solid var(--scc-border);
  border-radius: 7px;
  padding: 9px 12px;
  font-size: 13.5px;
  font-family: inherit;
  background: #f9fafb;
  transition: border-color .2s, background .2s;
  width: 100%; box-sizing: border-box;
  color: var(--scc-text);
}
.scc-input:focus { outline: none; border-color: #555; background: white; }
textarea.scc-input { resize: vertical; min-height: 75px; }
.scc-char { font-size: 11px; color: var(--scc-muted); text-align: right; }

/* Notice */
.scc-notice {
  margin: 0 20px 4px;
  padding: 9px 13px;
  border-radius: 7px;
  font-size: 13px;
  display: none;
}
.scc-notice.error   { background: #fff5f5; color: #c0392b; border: 1px solid #f5c6cb; display: block; }
.scc-notice.success { background: #f0fdf4; color: #166534; border: 1px solid #bbf7d0; display: block; }

/* Success screen */
.scc-success-screen {
  padding: 24px 20px;
  text-align: center;
}
.scc-success-icon  { font-size: 40px; line-height: 1; margin-bottom: 10px; }
.scc-success-title { margin: 0 0 8px; font-size: 18px; font-weight: 700; color: #166534; }
.scc-success-msg   { margin: 0 0 8px; font-size: 14px; color: var(--scc-muted); line-height: 1.6; }
.scc-success-order { font-size: 13px; font-weight: 600; color: var(--scc-muted); }

/* Submit */
.scc-submit {
  display: block;
  width: calc(100% - 40px);
  margin: 0 20px 20px;
  background: var(--scc-red);
  color: white;
  border: none;
  border-radius: 8px;
  padding: 13px;
  font-size: 14.5px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  transition: background .2s, transform .15s, box-shadow .15s;
  letter-spacing: .03em;
}
.scc-submit:hover:not(:disabled) {
  background: var(--scc-red-dk);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(230,57,70,.28);
}
.scc-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }

/* Spinner */
.scc-spinner {
  display: inline-block;
  width: 13px; height: 13px;
  border: 2px solid rgba(255,255,255,.4);
  border-top-color: white;
  border-radius: 50%;
  animation: scc-spin .65s linear infinite;
  vertical-align: middle;
  margin-right: 4px;
}
@keyframes scc-spin { to { transform: rotate(360deg); } }

/* ======== RESPONSIVE ======== */
@media (max-width: 720px) {
  .scc-wrapper { flex-direction: column; }
  .scc-right   { position: static; }
}
