/* CS Smart Forms – Frontend CSS v1.7 */

/* ── Grid ─────────────────────────────────────────────────────── */
.csf-form-wrap { width: 100%; }
.csf-fields-grid { display: flex; flex-wrap: wrap; gap: 10px; }
.csf-row { box-sizing: border-box; }
.csf-col-full  { width: 100%; }
.csf-col-half  { width: calc(50% - 5px); }
.csf-col-third { width: calc(33.333% - 7px); }
@media (max-width: 640px) {
  .csf-col-half, .csf-col-third { width: 100%; }
}

/* ── Field wrapper ────────────────────────────────────────────── */
.csf-field-wrap { width: 100%; }

/* ── Outer bordered box ───────────────────────────────────────── */
.csf-input-box {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 1px solid #004AAD;
  border-radius: 4px;
  background: #fff;
  height: 54px;
  box-sizing: border-box;
  transition: box-shadow .2s;
  overflow: visible;
}
.csf-input-box:focus-within {
  box-shadow: 0 0 0 3px rgba(0,127,21,.12);
}

/* ── Textarea box overrides ───────────────────────────────────── */
.csf-ta-box {
  height: 54px;
  align-items: stretch;
}
/* Tall textarea (contact form etc.) – activated by "Câmp înalt" (~2x default 54px) */
.csf-ta-box.csf-ta-large {
  height: auto !important;
  min-height: 108px !important;
}

/* ── Icon column (left side) ──────────────────────────────────── */
.csf-icon-cell {
  flex-shrink: 0;
  width: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #004AAD;
  font-size: 14px;
  border-right: 1px solid #e6edf9;
}
.csf-ta-box .csf-icon-cell {
  align-items: flex-start;
  padding-top: 16px;
}

/* ── Text / input column ──────────────────────────────────────── */
.csf-text-cell {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
}
.csf-ta-box .csf-text-cell {
  align-items: stretch;
}

/* ── Actual inputs inside the box ────────────────────────────── */
.csf-input-box input[type="text"],
.csf-input-box input[type="email"],
.csf-input-box input[type="tel"],
.csf-input-box input[type="url"],
.csf-input-box input[type="number"],
.csf-input-box input[type="date"],
.csf-input-box select {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0 12px !important;
  font-size: 14px !important;
  font-family: Inter, Arial, sans-serif !important;
  color: #222 !important;
  box-sizing: border-box !important;
  line-height: 1 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  -webkit-appearance: none;
  appearance: none;
}

/* ── Textarea ─────────────────────────────────────────────────── */
.csf-input-box textarea {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 24px 12px 6px !important;
  font-size: 14px !important;
  font-family: Inter, Arial, sans-serif !important;
  color: #222 !important;
  box-sizing: border-box !important;
  line-height: 1.5 !important;
  margin: 0 !important;
  border-radius: 0 !important;
  resize: none !important;
  overflow-y: auto !important;
  align-self: stretch;
}
/* Large textarea fills container properly */
.csf-ta-box.csf-ta-large textarea {
  height: auto !important;
  min-height: 90px !important;
}

/* ── Floating label ───────────────────────────────────────────── */
.csf-float-label {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  color: #000;
  font-weight: 400;
  background: #fff;
  padding: 0 3px;
  pointer-events: none;
  transition: top .16s ease, font-size .16s ease, color .16s ease, transform .16s ease;
  white-space: nowrap;
  max-width: calc(100% - 20px);
  overflow: hidden;
  text-overflow: ellipsis;
  z-index: 5;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.2;
  display: block;
}
.has-icon .csf-float-label {
  left: 49px;
  max-width: calc(100% - 65px);
}
.csf-ta-box .csf-float-label {
  top: 14px;
  transform: none;
}
.csf-ta-box.csf-ta-large .csf-float-label {
  top: 16px !important;
  transform: none !important;
}

/* Lifted state */
.csf-input-box input:focus ~ .csf-float-label,
.csf-input-box input.has-value ~ .csf-float-label,
.csf-input-box input:not(:placeholder-shown) ~ .csf-float-label,
.csf-input-box textarea:focus ~ .csf-float-label,
.csf-input-box textarea.has-value ~ .csf-float-label,
.csf-input-box textarea:not(:placeholder-shown) ~ .csf-float-label {
  top: 0;
  transform: translateY(-50%);
  font-size: 11px;
  color: #004AAD;
}

/* Always-lifted: select, date */
.csf-float-always-up {
  top: 0 !important;
  transform: translateY(-50%) !important;
  font-size: 11px !important;
  color: #004AAD !important;
}

/* ── Select placeholder ───────────────────────────────────────── */
.csf-input-box select:required:invalid {
  color: #000 !important;
  font-weight: 400 !important;
}

/* ── Select dropdown arrow ────────────────────────────────────── */
.csf-select-arrow {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  padding-right: 12px;
  color: #004AAD;
  font-size: 11px;
  pointer-events: none;
}

/* ── Character counter ────────────────────────────────────────── */
.csf-char-counter {
  font-size: 8px;
  color: #bbb;
  text-align: right;
  padding: 2px 4px 0;
  line-height: 1;
}

/* ── File upload ──────────────────────────────────────────────── */
.csf-file-real { display: none !important; }

.csf-file-label {
  cursor: pointer !important;
  text-decoration: none;
  height: 54px;
}
.csf-file-label:hover { box-shadow: 0 0 0 3px rgba(0,127,21,.12); }

.csf-file-text {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 0 12px;
  font-size: 14px;
  font-family: Inter, Arial, sans-serif;
  color: #999;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.csf-file-label.has-file .csf-file-text { color: #333; }

/* ── GDPR ─────────────────────────────────────────────────────── */
.csf-gdpr-row { margin: 14px 0 8px; }
.csf-gdpr-label {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 13px;
  font-family: Inter, Arial, sans-serif;
  color: #555;
  cursor: pointer;
  line-height: 1.5;
}
.csf-gdpr-label input[type=checkbox] {
  width: 16px; height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  accent-color: #004AAD;
  cursor: pointer;
}
.csf-gdpr-label a { color: #004AAD; text-decoration: underline; }
.csf-gdpr-label strong { color: #004AAD; }

/* ── Submit button ────────────────────────────────────────────── */
.csf-submit-row { margin: 12px 0 0; }
.csf-btn-submit,
.csf-form-wrap .csf-btn-submit,
.csf-form-wrap .csf-btn-submit.loading {
  display: inline-flex !important;
  flex-direction: row !important;
  align-items: center !important;
  gap: 8px !important;
  background: #004AAD;
  color: #fff;
  border: none;
  padding: 0 19px !important;
  height: 39px !important;
  min-height: 39px !important;
  max-height: 39px !important;
  border-radius: 4px;
  font-size: 16px;
  font-weight: 400;
  cursor: pointer;
  transition: background .2s;
  font-family: Inter, Arial, sans-serif;
  white-space: nowrap;
  box-sizing: border-box !important;
  width: auto !important;
  overflow: hidden !important;
}
.csf-btn-submit:hover { background: #003580; }
.csf-form-wrap .csf-btn-submit .csf-btn-arrow { font-size: 13px !important; }
.csf-form-wrap .csf-btn-submit .fa-circle-notch { font-size: 13px !important; }
.csf-btn-submit.loading { opacity: .75; pointer-events: none; }

/* ── Field errors ─────────────────────────────────────────────── */
.csf-field-error { color: #d32f2f; font-size: 12px; margin-top: 3px; min-height: 14px; }
#csf-gdpr-error  { color: #d32f2f; font-size: 12px; margin-top: 4px; }

/* ── Response banner ──────────────────────────────────────────── */
.csf-response { border-radius: 4px; padding: 12px 16px; margin-top: 12px; font-size: 14px; }
.csf-response.error { background: #fdecea; border: 1px solid #d32f2f; color: #c62828; }

/* ── Success overlay ──────────────────────────────────────────── */
.csf-success-wrap { text-align: center; padding: 36px 24px 28px; animation: csfFadeUp .4s ease; }
@keyframes csfFadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
.csf-success-icon {
  display: inline-flex; align-items: center; justify-content: center;
  width: 68px; height: 68px; background: #004AAD; border-radius: 50%;
  font-size: 28px; color: #fff; margin-bottom: 18px;
  box-shadow: 0 4px 18px rgba(0,127,21,.28);
}
.csf-success-message {
  font-size: 15px; line-height: 1.7; color: #444;
  max-width: 460px; margin: 0 auto; font-family: Inter, Arial, sans-serif;
}
.csf-success-message strong { color: #004AAD; font-size: 18px; display: block; margin-bottom: 8px; }

/* ── Rating ───────────────────────────────────────────────────── */
.csf-rating-wrap { display: flex; flex-direction: row-reverse; justify-content: flex-start; gap: 4px; padding: 8px 0 4px; }
.csf-rating-wrap input[type=radio] { display: none; }
.csf-rating-wrap label { font-size: 30px; color: #ddd; cursor: pointer; transition: color .1s; line-height: 1; }
.csf-rating-wrap label:hover,
.csf-rating-wrap label:hover ~ label,
.csf-rating-wrap input:checked ~ label { color: #f9a825; }
.csf-rating-label { font-size: 13px; color: #777; margin-top: 2px; }

/* ── Heading ──────────────────────────────────────────────────── */
.csf-heading { margin: 6px 0 0; font-size: 17px; color: #222; border-bottom: 2px solid #004AAD; padding-bottom: 6px; }

/* ── Checkbox field ───────────────────────────────────────────── */
.csf-checkbox-label { display: flex; align-items: flex-start; gap: 8px; font-size: 14px; cursor: pointer; font-family: Inter, Arial, sans-serif; line-height: 1.4; }
.csf-checkbox-label input { accent-color: #004AAD; width: 16px; height: 16px; flex-shrink: 0; margin-top: 2px; }

/* ── Multi-checkbox field ─────────────────────────────────────── */
.csf-cb-multi {
  border: 1px solid #c5cfdf;
  border-radius: 10px;
  padding: 14px 18px 18px;
  margin: 4px 0;
  background: #fafbfd;
}
.csf-cb-multi-legend {
  font-size: 14px;
  font-weight: 600;
  color: #004AAD;
  padding: 0 8px;
  margin-bottom: 4px;
}
.csf-cb-multi-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 14px 24px;
  margin-top: 10px;
}
.csf-cb-multi-item {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  font-size: 14px;
  cursor: pointer;
  font-family: Inter, Arial, sans-serif;
  line-height: 1.4;
  padding: 8px 10px;
  border-radius: 6px;
  transition: background .12s ease, color .12s ease;
  user-select: none;
}
.csf-cb-multi-item:hover {
  background: #e6edf9;
  color: #004AAD;
}
.csf-cb-multi-item input {
  accent-color: #004AAD;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 1px;
  cursor: pointer;
}
.csf-cb-multi-item input:checked + span {
  color: #004AAD;
  font-weight: 500;
}
.csf-cb-multi.has-error { border-color: #d9534f; background: #fdf3f3; }
@media (max-width: 760px) { .csf-cb-multi-grid { grid-template-columns: 1fr !important; gap: 6px 0; } }

/* ── Readonly / calculator field ──────────────────────────────── */
.csf-input-box.csf-readonly {
  background: #f6f9fc;
  border-color: #bcd1ee;
  cursor: default;
}
.csf-input-box.csf-readonly input {
  color: #444 !important;
  cursor: default !important;
  background: transparent !important;
  font-weight: 600 !important;
}
.csf-input-box.csf-readonly .csf-float-label {
  color: #5a7baf !important;
}
