/* Árajánlat kalkulátor egyedi stílusok */
.calc-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 28px;
  align-items: start;
  margin-top: 20px;
}

.calc-group {
  background: #fff;
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 12px;
  margin-bottom: 16px;
  overflow: hidden;
}

.calc-group-header {
  padding: 16px 20px 14px;
  background: var(--c-highlight-bg, #f7f9fc);
  border-bottom: 1px solid var(--c-border, #e2e8f0);
}

.calc-group-header h2 {
  margin: 0 0 5px 0;
  font-size: 19px;
  color: var(--c-primary, #0d2c54);
}

.calc-group-header p {
  margin: 0;
  color: var(--c-text-soft, #475569);
  font-size: 14px;
  line-height: 1.5;
}

.calc-included {
  margin-top: 10px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.calc-included span {
  font-size: 12px;
  color: var(--c-text-soft, #475569);
  background: #fff;
  border: 1px solid var(--c-border, #e2e8f0);
  padding: 4px 10px;
  border-radius: 12px;
}

.calc-item {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 20px;
  padding: 12px 20px;
  border-top: 1px solid #f0f0f0;
}

.calc-item:first-of-type { border-top: none; }

.calc-item-info { min-width: 0; }

.calc-item-name {
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 3px;
}

.calc-item-desc {
  font-size: 13px;
  color: var(--c-text-muted, #64748b);
  line-height: 1.4;
}

.calc-qty {
  display: flex;
  align-items: center;
  background: var(--c-bg-soft, #eef2f7);
  border-radius: 8px;
  padding: 3px;
}

.calc-qty-btn {
  width: 30px;
  height: 30px;
  border: none;
  background: transparent;
  color: var(--c-text-soft, #475569);
  cursor: pointer;
  border-radius: 6px;
  font-size: 17px;
  font-weight: 500;
  font-family: inherit;
}

.calc-qty-btn:hover { background: #fff; }

.calc-qty-input {
  width: 42px;
  height: 30px;
  border: none;
  background: transparent;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  -moz-appearance: textfield;
  font-family: inherit;
}

.calc-qty-input::-webkit-outer-spin-button,
.calc-qty-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.calc-qty-input:focus { outline: none; }

.calc-customer {
  background: #fff;
  border: 1px solid var(--c-border, #e2e8f0);
  border-radius: 12px;
  padding: 28px;
  margin-bottom: 24px;
}

.calc-customer h2 {
  margin: 0 0 6px 0;
  font-size: 22px;
}

.calc-customer-sub {
  margin: 0 0 22px 0;
  color: var(--c-text-soft, #475569);
  font-size: 14px;
}

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

.calc-form-group { display: flex; flex-direction: column; }

.calc-form-group.full { grid-column: 1 / -1; }

.calc-form-group label {
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--c-text-soft, #475569);
}

.calc-form-group label .req { color: #c0392b; }

.calc-form-group input,
.calc-form-group textarea {
  border: 1.5px solid var(--c-border-strong, #cbd5e1);
  background: #fff;
  border-radius: 8px;
  padding: 11px 14px;
  font-size: 14px;
  font-family: inherit;
  color: var(--c-text, #1a2233);
}

.calc-form-group input:focus,
.calc-form-group textarea:focus {
  outline: none;
  border-color: var(--c-accent, #0d8a8e);
}

.calc-form-group textarea {
  resize: vertical;
  min-height: 90px;
}

/* Sticky összegzés */
.calc-summary-wrap {
  position: sticky;
  top: 24px;
}

/* Sok tétel esetén a lista görgethető, hogy a gomb ne csússzon a képernyő alá */
#summaryContent {
  max-height: 46vh;
  overflow-y: auto;
  overscroll-behavior: contain;
}

#summaryContent::-webkit-scrollbar { width: 5px; }
#summaryContent::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.22);
  border-radius: 3px;
}

.calc-summary {
  background: var(--c-primary, #0d2c54);
  color: #fff;
  border-radius: 12px;
  padding: 22px;
}

.calc-summary h2 {
  margin: 0 0 4px 0;
  font-size: 20px;
  color: #fff;
}

.calc-summary-sub {
  margin: 0 0 14px 0;
  font-size: 13px;
  color: rgba(255,255,255,0.65);
}

.calc-summary-section {
  border-top: 1px solid rgba(255,255,255,0.14);
  padding: 10px 0;
}

.calc-summary-section:first-of-type {
  border-top: none;
  padding-top: 0;
}

.calc-summary-group-title {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: rgba(255,255,255,0.55);
  margin-bottom: 5px;
}

.calc-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.45;
  margin-bottom: 3px;
}

.calc-summary-line .name {
  color: rgba(255,255,255,0.75);
}

.calc-summary-line .value {
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  margin-left: 10px;
}

.calc-summary-empty {
  color: rgba(255,255,255,0.5);
  font-size: 13px;
  font-style: italic;
}


.calc-submit {
  width: 100%;
  padding: 14px;
  background: #fff;
  color: var(--c-primary, #0d2c54);
  border: none;
  border-radius: 8px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-top: 16px;
  font-family: inherit;
}

.calc-submit:hover { background: #f0f0f0; }

.calc-submit:disabled {
  background: rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.4);
  cursor: not-allowed;
}

.calc-note {
  font-size: 11px;
  color: rgba(255,255,255,0.5);
  text-align: center;
  margin-top: 12px;
  line-height: 1.5;
}

/* Sikeres küldés modal */
.calc-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.calc-modal.active { display: flex; }

.calc-modal-card {
  background: #fff;
  border-radius: 12px;
  padding: 36px;
  max-width: 440px;
  width: 100%;
  text-align: center;
}

.calc-modal-icon {
  width: 60px;
  height: 60px;
  background: #e8f5e9;
  color: #2e7d32;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
  font-size: 30px;
  font-weight: 700;
}

.calc-modal-card h3 {
  margin: 0 0 8px 0;
  font-size: 22px;
}

.calc-modal-card p {
  color: var(--c-text-soft, #475569);
  margin-bottom: 22px;
  font-size: 14px;
}

@media (max-width: 1024px) {
  .calc-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }
  .calc-summary-wrap {
    position: static;
    order: -1;
  }
}

@media (max-width: 720px) {
  .calc-item {
    grid-template-columns: 1fr;
    gap: 12px;
    padding: 16px 20px;
  }
  .calc-qty { justify-self: start; }
  .calc-group-header { padding: 20px 20px 14px; }
  .calc-customer { padding: 22px; }
  .calc-form-grid { grid-template-columns: 1fr; }
  .calc-summary { padding: 22px; }
}

/* ==========================================================================
   Űrlap állapotok: honeypot, hozzájárulás, hibajelzés, betöltés
   ========================================================================== */

/* Honeypot mező - láthatatlan, de a böngészőben létezik */
.calc-hp {
  position: absolute;
  left: -10000px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* Adatkezelési hozzájárulás checkbox */
.calc-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--c-text-soft, #475569);
  cursor: pointer;
  font-weight: normal;
}

.calc-consent input[type="checkbox"] {
  margin-top: 2px;
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  cursor: pointer;
}

.calc-consent a {
  color: var(--c-accent, #0d8a8e);
  text-decoration: underline;
}

/* Hibaüzenet a submit gomb alatt */
.calc-error {
  color: #fca5a5;
  font-size: 13px;
  margin-top: 12px;
  margin-bottom: 0;
  line-height: 1.4;
  text-align: center;
}

/* Submit gomb loading állapot */
.calc-submit.is-loading {
  opacity: 0.7;
  cursor: wait;
  position: relative;
}

.calc-submit.is-loading::after {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-left: 10px;
  border: 2px solid rgba(26,26,26,0.3);
  border-top-color: var(--c-primary, #0d2c54);
  border-radius: 50%;
  vertical-align: -3px;
  animation: calc-spin 0.6s linear infinite;
}

@keyframes calc-spin {
  to { transform: rotate(360deg); }
}

/* Mezőhiba állapot */
.calc-form-group.has-error input,
.calc-form-group.has-error textarea {
  border-color: #c0392b;
}

.calc-form-group .field-error {
  color: #c0392b;
  font-size: 12px;
  margin-top: 4px;
}
