/* ============================================================
   DUGENTO LEADS & FORMS PRO — Frontend Styles
   100% Self-Contained, Theme-Independent Architecture
   ============================================================ */

:root {
  --dl-primary:       #1C2AB5;
  --dl-primary-hover: #1620A0;
  --dl-primary-light: #EEF2FF;
  --dl-bg:            #FFFFFF;
  --dl-bg-alt:        #F8FAFC;
  --dl-text:          #09131E;
  --dl-text-muted:    #64748B;
  --dl-line:          #DDE2EB;
  --dl-line-focus:    #1C2AB5;
  --dl-success:       #059669;
  --dl-error:         #DC2626;
  --dl-radius:        8px;
  --dl-radius-sm:     6px;
  --dl-radius-lg:     12px;
  --dl-font:          system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --dl-transition:    all 0.2s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Container ─────────────────────────────────────────────── */
.dl-form-container {
  font-family: var(--dl-font);
  color: var(--dl-text);
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
}

.dl-form-container *,
.dl-form-container *::before,
.dl-form-container *::after {
  box-sizing: border-box;
}

/* ── Form Card ─────────────────────────────────────────────── */
.dl-form-card {
  background: var(--dl-bg);
  border: 1px solid var(--dl-line);
  border-radius: var(--dl-radius-lg);
  padding: clamp(20px, 4vw, 36px);
  box-shadow: 0 4px 20px -2px rgba(9, 19, 30, 0.04), 0 2px 6px -1px rgba(9, 19, 30, 0.02);
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  overflow-x: hidden;
}

@media (max-width: 640px) {
  .dl-form-card {
    padding: 20px 16px;
  }
}

.dl-form-header {
  margin-bottom: 24px;
}

.dl-form-title {
  font-size: clamp(20px, 3vw, 26px);
  font-weight: 600;
  color: var(--dl-text);
  margin: 0 0 8px 0;
  line-height: 1.25;
}

.dl-form-desc {
  font-size: 15px;
  color: var(--dl-text-muted);
  margin: 0;
  line-height: 1.6;
}

/* ── Form Groups & Layouts ──────────────────────────────────── */
.dl-form-group {
  margin-bottom: 20px;
}

.dl-grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

@media (max-width: 640px) {
  .dl-grid-2 {
    grid-template-columns: 1fr;
  }
}

.dl-label {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-text);
  margin-bottom: 6px;
}

.dl-step-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--dl-primary);
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
  flex-shrink: 0;
}

.dl-required {
  color: var(--dl-error);
  font-weight: 700;
}

.dl-hint {
  font-size: 11px;
  color: var(--dl-text-muted);
  font-weight: 400;
  display: block;
  margin-top: 4px;
}

/* ── Form Inputs ────────────────────────────────────────────── */
.dl-input,
.dl-textarea,
.dl-select {
  width: 100%;
  height: 46px;
  padding: 10px 14px;
  font-family: inherit;
  font-size: 14px;
  color: var(--dl-text);
  background: var(--dl-bg);
  border: 1.5px solid var(--dl-line);
  border-radius: var(--dl-radius);
  transition: var(--dl-transition);
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}

.dl-input[type="date"],
.dl-input[type="time"],
.dl-input[type="datetime-local"] {
  appearance: auto;
  -webkit-appearance: auto;
  cursor: pointer;
}

.dl-input[type="date"]::-webkit-calendar-picker-indicator,
.dl-input[type="time"]::-webkit-calendar-picker-indicator,
.dl-input[type="datetime-local"]::-webkit-calendar-picker-indicator {
  display: block;
  cursor: pointer;
  opacity: 0.65;
  padding: 4px;
}

.dl-input[type="date"]::-webkit-calendar-picker-indicator:hover,
.dl-input[type="time"]::-webkit-calendar-picker-indicator:hover,
.dl-input[type="datetime-local"]::-webkit-calendar-picker-indicator:hover {
  opacity: 1;
}

.dl-textarea {
  height: auto;
  min-height: 100px;
  resize: vertical;
  line-height: 1.5;
}

.dl-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 14px center;
  padding-right: 40px;
  cursor: pointer;
}

.dl-input:focus,
.dl-textarea:focus,
.dl-select:focus {
  border-color: var(--dl-line-focus);
  box-shadow: 0 0 0 3px rgba(28, 42, 181, 0.12);
  background: #ffffff;
}

.dl-input::placeholder,
.dl-textarea::placeholder {
  color: #94A3B8;
}

/* ── Interactive Date Selection Grid (Randevu) ──────────────── */
.dl-days-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 8px;
}

@media (max-width: 768px) {
  .dl-days-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .dl-days-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dl-day-item {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.dl-day-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dl-day-inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 12px 6px;
  background: var(--dl-bg);
  border: 1.5px solid var(--dl-line);
  border-radius: var(--dl-radius);
  text-align: center;
  transition: var(--dl-transition);
}

.dl-day-name {
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--dl-text-muted);
  letter-spacing: 0.5px;
}

.dl-day-num {
  font-size: 20px;
  font-weight: 700;
  color: var(--dl-text);
  margin: 2px 0;
}

.dl-day-month {
  font-size: 11px;
  color: var(--dl-text-muted);
}

.dl-day-item:hover .dl-day-inner {
  border-color: var(--dl-primary);
  background: var(--dl-bg-alt);
}

.dl-day-item.is-selected .dl-day-inner,
.dl-day-item input[type="radio"]:checked + .dl-day-inner {
  border-color: var(--dl-primary);
  background: var(--dl-primary-light);
}

.dl-day-item.is-selected .dl-day-name,
.dl-day-item.is-selected .dl-day-num,
.dl-day-item.is-selected .dl-day-month,
.dl-day-item input[type="radio"]:checked + .dl-day-inner * {
  color: var(--dl-primary);
}

/* ── Interactive Time Slot Grid (Randevu) ───────────────────── */
.dl-slots-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

@media (max-width: 640px) {
  .dl-slots-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 480px) {
  .dl-slots-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

.dl-slot-item {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.dl-slot-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dl-slot-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 10px 12px;
  background: var(--dl-bg);
  border: 1.5px solid var(--dl-line);
  border-radius: var(--dl-radius);
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-text);
  transition: var(--dl-transition);
}

.dl-slot-item:hover .dl-slot-inner {
  border-color: var(--dl-primary);
  background: var(--dl-bg-alt);
}

.dl-slot-item.is-selected .dl-slot-inner,
.dl-slot-item input[type="radio"]:checked + .dl-slot-inner {
  background: var(--dl-primary);
  border-color: var(--dl-primary);
  color: #ffffff;
}

.dl-slot-item.is-booked {
  opacity: 0.38;
  cursor: not-allowed;
  pointer-events: none;
}

.dl-slot-item.is-booked .dl-slot-inner {
  background: #f1f5f9;
  border-color: #e2e8f0;
  color: #94a3b8;
  text-decoration: line-through;
}


/* ── Live Selection Banner (Randevu) ────────────────────────── */
.dl-selection-summary {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: var(--dl-primary-light);
  border: 1px solid rgba(28, 42, 181, 0.15);
  border-radius: var(--dl-radius-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-primary);
  margin-top: 10px;
}

/* ── Pill Choices (Services & Budget) ───────────────────────── */
.dl-pills-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.dl-pill-item {
  position: relative;
  cursor: pointer;
  margin: 0;
}

.dl-pill-item input[type="checkbox"],
.dl-pill-item input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.dl-pill-inner {
  display: inline-flex;
  align-items: center;
  padding: 8px 16px;
  background: var(--dl-bg);
  border: 1.5px solid var(--dl-line);
  border-radius: 20px;
  font-size: 13px;
  font-weight: 500;
  color: var(--dl-text);
  transition: var(--dl-transition);
  user-select: none;
}

.dl-pill-item:hover .dl-pill-inner {
  border-color: var(--dl-primary);
  background: var(--dl-bg-alt);
}

.dl-pill-item input:checked + .dl-pill-inner {
  background: var(--dl-primary-light);
  border-color: var(--dl-primary);
  color: var(--dl-primary);
  font-weight: 600;
}

/* ── Checkbox (KVKK / GDPR) ─────────────────────────────────── */
.dl-checkbox-wrap {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 16px;
  margin-bottom: 20px;
  cursor: pointer;
  font-size: 13px;
  color: var(--dl-text-muted);
  line-height: 1.5;
}

.dl-checkbox-wrap input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  border-radius: 4px;
  border: 1.5px solid var(--dl-line);
  cursor: pointer;
  accent-color: var(--dl-primary);
  flex-shrink: 0;
}

.dl-checkbox-wrap a {
  color: var(--dl-primary);
  text-decoration: underline;
}

/* ── Submit Button ──────────────────────────────────────────── */
.dl-btn-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  padding: 0 24px;
  background: var(--dl-primary);
  color: #ffffff;
  border: none;
  border-radius: var(--dl-radius);
  font-family: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--dl-transition);
  text-align: center;
}

.dl-btn-submit:hover {
  background: var(--dl-primary-hover);
  box-shadow: 0 4px 14px rgba(28, 42, 181, 0.25);
  transform: translateY(-1px);
}

.dl-btn-submit:active {
  transform: translateY(0);
}

.dl-btn-submit:disabled,
.dl-btn-submit.is-loading {
  opacity: 0.7;
  cursor: not-allowed;
  transform: none;
}

.dl-btn-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.3);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: dl-spin 0.6s linear infinite;
  display: none;
}

.dl-btn-submit.is-loading .dl-btn-spinner {
  display: inline-block;
}

.dl-btn-submit.is-loading .dl-btn-icon {
  display: none;
}

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

.dl-guarantee-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12px;
  color: var(--dl-text-muted);
  margin-top: 12px;
  text-align: center;
}

/* ── Notifications & Feedback States ────────────────────────── */
.dl-alert {
  padding: 14px 18px;
  border-radius: var(--dl-radius);
  font-size: 14px;
  margin-bottom: 20px;
  display: none;
  animation: dl-fade-in 0.3s ease;
}

.dl-alert-error {
  background: #FEF2F2;
  border: 1px solid #FCA5A5;
  color: #991B1B;
}

.dl-success-card {
  text-align: center;
  padding: 36px 20px;
  animation: dl-fade-in 0.4s ease;
}

.dl-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: #ECFDF5;
  color: var(--dl-success);
  margin-bottom: 16px;
}

.dl-success-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--dl-text);
  margin: 0 0 10px 0;
}

.dl-success-desc {
  font-size: 15px;
  color: var(--dl-text-muted);
  max-width: 480px;
  margin: 0 auto;
  line-height: 1.6;
}

@keyframes dl-fade-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── Fallback Notice for Admins ──────────────────────────────── */
.dl-admin-notice-card {
  background: #FFFBEB;
  border: 1px solid #FCD34D;
  border-radius: var(--dl-radius);
  padding: 16px 20px;
  font-size: 13px;
  color: #92400E;
  margin: 16px 0;
  display: flex;
  align-items: center;
  gap: 12px;
}

/* ── Visual Builder & Multi-Step Wizard ─────────────────────── */
.dl-multistep-header {
  margin-bottom: 24px;
}

.dl-step-pills {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}

.dl-step-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--dl-bg-alt);
  border: 1px solid var(--dl-line);
  font-size: 13px;
  font-weight: 500;
  color: var(--dl-text-muted);
  white-space: nowrap;
  transition: var(--dl-transition);
}

.dl-step-pill.is-active {
  background: var(--dl-primary-light);
  border-color: var(--dl-primary);
  color: var(--dl-primary);
  font-weight: 600;
}

.dl-step-pill.is-completed {
  background: #ECFDF5;
  border-color: #A7F3D0;
  color: var(--dl-success);
}

.dl-step-pill-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: currentColor;
  color: #ffffff;
  font-size: 11px;
  font-weight: 700;
}

.dl-step-pill.is-active .dl-step-pill-num,
.dl-step-pill.is-completed .dl-step-pill-num {
  background: currentColor;
}

.dl-progress-bar-wrap {
  margin-bottom: 20px;
}

.dl-progress-bar-info {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: var(--dl-text-muted);
  margin-bottom: 6px;
}

.dl-progress-bar-track {
  height: 6px;
  background: var(--dl-line);
  border-radius: 999px;
  overflow: hidden;
}

.dl-progress-bar-fill {
  height: 100%;
  background: var(--dl-primary);
  transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
  border-radius: 999px;
}

/* ── Grid Columns for Custom Form Builder ───────────────────── */
.dl-fields-grid {
  display: flex;
  flex-wrap: wrap;
  margin: -8px;
  width: calc(100% + 16px);
  max-width: calc(100% + 16px);
  box-sizing: border-box;
}

.dl-field-col {
  box-sizing: border-box;
  padding: 8px;
}

.dl-col-100 {
  flex: 0 0 100%;
  max-width: 100%;
}

.dl-col-50 {
  flex: 0 0 50%;
  max-width: 50%;
}

.dl-col-33 {
  flex: 0 0 33.333%;
  max-width: 33.333%;
}

@media (max-width: 640px) {
  .dl-fields-grid {
    margin: 0;
    width: 100%;
    max-width: 100%;
  }

  .dl-field-col {
    padding: 8px 0;
  }

  .dl-col-50,
  .dl-col-33 {
    flex: 0 0 100%;
    max-width: 100%;
  }
}

/* ── Custom Field Elements ──────────────────────────────────── */
.dl-field-heading {
  font-size: 18px;
  font-weight: 700;
  color: var(--dl-text);
  margin: 14px 0 6px 0;
  line-height: 1.3;
}

.dl-field-divider {
  border: 0;
  border-top: 1px solid var(--dl-line);
  margin: 16px 0;
}

.dl-field-html {
  font-size: 14px;
  color: var(--dl-text-muted);
  line-height: 1.5;
  margin: 6px 0;
}

.dl-radio-group,
.dl-checkbox-group {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 4px;
  width: 100%;
  box-sizing: border-box;
}

.dl-radio-item,
.dl-checkbox-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1.5px solid var(--dl-line);
  border-radius: var(--dl-radius);
  background: var(--dl-bg);
  font-size: 13px;
  cursor: pointer;
  transition: var(--dl-transition);
  max-width: 100%;
  box-sizing: border-box;
  word-break: break-word;
}

@media (max-width: 640px) {
  .dl-radio-group,
  .dl-checkbox-group {
    flex-direction: column;
    gap: 8px;
  }

  .dl-radio-item,
  .dl-checkbox-item {
    width: 100%;
    display: flex;
  }
}

.dl-radio-item:hover,
.dl-checkbox-item:hover {
  border-color: var(--dl-primary);
}

.dl-radio-item input:checked + .dl-radio-label,
.dl-checkbox-item input:checked + .dl-checkbox-label {
  color: var(--dl-primary);
  font-weight: 600;
}

/* ── File Dropzone ─────────────────────────────────────────── */
.dl-file-dropzone {
  position: relative;
  border: 2px dashed var(--dl-line);
  border-radius: var(--dl-radius);
  padding: 24px;
  text-align: center;
  background: var(--dl-bg-alt);
  cursor: pointer;
  transition: var(--dl-transition);
}

.dl-file-dropzone:hover {
  border-color: var(--dl-primary);
  background: var(--dl-primary-light);
}

.dl-file-input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.dl-file-placeholder {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--dl-text-muted);
  pointer-events: none;
}

.dl-file-name-preview {
  margin-top: 8px;
  font-size: 13px;
  font-weight: 600;
  color: var(--dl-primary);
  pointer-events: none;
}

/* ── Conditional Logic & Navigation ─────────────────────────── */
.dl-conditional-hidden {
  display: none !important;
}

.dl-btn-prev {
  background: var(--dl-bg);
  border: 1px solid var(--dl-line);
  color: var(--dl-text);
  padding: 10px 18px;
  border-radius: var(--dl-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--dl-transition);
}

.dl-btn-prev:hover {
  border-color: var(--dl-text-muted);
  background: var(--dl-bg-alt);
}

.dl-btn-next {
  background: var(--dl-primary);
  border: 1px solid var(--dl-primary);
  color: #ffffff;
  padding: 10px 20px;
  border-radius: var(--dl-radius);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--dl-transition);
}

.dl-btn-next:hover {
  background: var(--dl-primary-hover);
  border-color: var(--dl-primary-hover);
}

/* ── Form Error & Validation Alerts ─────────────────────────── */
.dl-alert {
  padding: 12px 16px;
  border-radius: var(--dl-radius);
  font-size: 13.5px;
  line-height: 1.5;
  margin-bottom: 20px;
  display: none;
}

.dl-alert-error {
  background: #fef2f2;
  border: 1.5px solid #fecaca;
  color: #dc2626;
  font-weight: 500;
  display: none;
}

.dl-input.dl-input-error,
.dl-textarea.dl-input-error,
.dl-select.dl-input-error {
  border-color: #dc2626 !important;
  background-color: #fff8f8 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.12) !important;
}

.dl-field-error-text {
  color: #dc2626;
  font-size: 12px;
  font-weight: 600;
  margin-top: 5px;
  display: flex;
  align-items: center;
  gap: 4px;
  animation: dlFadeIn 0.2s ease-in-out;
}

@keyframes dlFadeIn {
  from { opacity: 0; transform: translateY(-2px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Cloudflare Turnstile Anti-Bot Widget ─────────────────── */
.dl-turnstile-wrapper {
  margin: 16px 0 14px 0;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  min-height: 65px;
  width: 100%;
  max-width: 100%;
  overflow-x: auto;
  box-sizing: border-box;
}

.dl-turnstile-wrapper .cf-turnstile,
.dl-turnstile-wrapper iframe {
  max-width: 100% !important;
}

@media (max-width: 360px) {
  .dl-turnstile-wrapper .cf-turnstile {
    transform: scale(0.92);
    transform-origin: left center;
  }
}

/* ── Form Navigation / Step Actions ────────────────────────── */
.dl-step-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
  width: 100%;
  box-sizing: border-box;
}

@media (max-width: 640px) {
  .dl-step-actions {
    flex-direction: column-reverse;
    gap: 12px;
  }

  .dl-step-actions > div {
    width: 100%;
  }

  .dl-step-actions .dl-btn-submit,
  .dl-step-actions .dl-btn-next,
  .dl-step-actions .dl-btn-prev {
    width: 100%;
    justify-content: center;
  }
}


