:root {
  --artan-crm-cream: var(--cream, #fbf8f2);
  --artan-crm-paper: var(--paper, #f6ecdd);
  --artan-crm-orange: var(--orange, #f28c28);
  --artan-crm-orange-deep: var(--orange-deep, #d97212);
  --artan-crm-charcoal: var(--charcoal, #2b2b2b);
  --artan-crm-muted: var(--muted, #77716a);
  --artan-crm-border: #8a8177;
  --artan-crm-danger: var(--danger, #c93c3c);
  --artan-crm-ease: var(--ease, cubic-bezier(.4, 0, .2, 1));
}

.artan-crm-dialog[hidden],
.artan-crm-success[hidden],
.artan-crm-form__fields[hidden] { display: none !important; }

.artan-crm-dialog {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  font-family: inherit;
}

.artan-crm-dialog__backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: rgba(23, 22, 20, .72);
  cursor: pointer;
  backdrop-filter: blur(4px);
}

.artan-crm-dialog__sheet {
  position: relative;
  width: min(1040px, 100%);
  max-height: min(820px, calc(100vh - 48px));
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 18px;
  background: var(--artan-crm-cream);
  box-shadow: 0 28px 80px rgba(20, 19, 18, .32);
  display: grid;
  grid-template-columns: minmax(300px, .82fr) minmax(0, 1.38fr);
  animation: artan-crm-enter 180ms var(--artan-crm-ease) both;
}

.artan-crm-dialog__close {
  position: absolute;
  z-index: 3;
  top: 14px;
  left: 14px;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 2px solid var(--artan-crm-orange);
  border-radius: 50%;
  color: #fff;
  background: var(--artan-crm-charcoal);
  box-shadow: 0 4px 16px rgba(20, 19, 18, .24);
  display: grid;
  place-items: center;
  font-size: 30px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 160ms var(--artan-crm-ease), transform 160ms var(--artan-crm-ease);
}

.artan-crm-dialog__close:hover { border-color: var(--artan-crm-orange-deep); background: var(--artan-crm-orange-deep); transform: rotate(4deg); }
.artan-crm-dialog__close:focus-visible { outline: 3px solid var(--artan-crm-orange); outline-offset: 3px; }

.artan-crm-dialog__intro {
  padding: 54px 42px 38px;
  color: #fff;
  background: var(--artan-crm-charcoal);
  display: flex;
  flex-direction: column;
  min-height: 620px;
}

.artan-crm-dialog__eyebrow { margin: 0; color: #ffd0a3; font-size: 13px; font-weight: 700; }
.artan-crm-dialog__rule { width: 56px; height: 4px; margin: 14px 0 22px; background: var(--artan-crm-orange); }
.artan-crm-dialog__intro h2 { margin: 0; color: #fff; font-size: clamp(30px, 3.2vw, 44px); line-height: 1.28; }
.artan-crm-dialog__intro > p:not(.artan-crm-dialog__eyebrow, .artan-crm-dialog__response) { margin: 18px 0 0; color: rgba(255, 255, 255, .72); line-height: 1.85; }

.artan-crm-dialog__promises { margin: 34px 0 24px; padding: 0; list-style: none; counter-reset: none; }
.artan-crm-dialog__promises li { min-height: 48px; padding: 11px 0; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; align-items: center; gap: 13px; color: rgba(255, 255, 255, .88); }
.artan-crm-dialog__promises li:last-child { border-bottom: 1px solid rgba(255, 255, 255, .14); }
.artan-crm-dialog__promises span { color: var(--artan-crm-orange); font-size: 12px; font-weight: 700; }
.artan-crm-dialog__response { margin: auto 0 0; color: #fff; font-size: 13px; }
.artan-crm-dialog__response span { margin-left: 7px; color: var(--artan-crm-orange); }
.artan-crm-dialog__fallback { min-height: 44px; margin-top: 10px; display: inline-flex; align-items: center; color: #ffd0a3; font-size: 13px; text-decoration: underline; text-underline-offset: 4px; }

.artan-crm-dialog__form-panel {
  min-width: 0;
  max-height: min(820px, calc(100vh - 48px));
  overflow-y: auto;
  padding: 54px 48px 36px;
  background-color: var(--artan-crm-cream);
  background-image: linear-gradient(rgba(43, 43, 43, .035) 1px, transparent 1px), linear-gradient(90deg, rgba(43, 43, 43, .035) 1px, transparent 1px);
  background-size: 24px 24px;
  scrollbar-gutter: stable;
}

.artan-crm-form { color: var(--artan-crm-charcoal); }
.artan-crm-form__fields { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 17px 14px; }
.artan-crm-field { min-width: 0; }
.artan-crm-field--wide { grid-column: 1 / -1; }
.artan-crm-field > label { margin-bottom: 6px; display: block; color: var(--artan-crm-charcoal); font-size: 14px; font-weight: 600; }
.artan-crm-field > label span { color: var(--artan-crm-orange-deep); }

.artan-crm-field input:not([type="checkbox"]),
.artan-crm-field select,
.artan-crm-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 13px;
  border: 1px solid var(--artan-crm-border);
  border-radius: 9px;
  color: var(--artan-crm-charcoal);
  background: rgba(255, 255, 255, .88);
  font: inherit;
  transition: border-color 150ms var(--artan-crm-ease), box-shadow 150ms var(--artan-crm-ease), background-color 150ms var(--artan-crm-ease);
}

.artan-crm-field textarea { min-height: 92px; resize: vertical; }
.artan-crm-field input:focus,
.artan-crm-field select:focus,
.artan-crm-field textarea:focus { border-color: var(--artan-crm-orange); background: #fff; box-shadow: 0 0 0 3px rgba(242, 140, 40, .15); }
.artan-crm-field input:not([type="checkbox"]):focus-visible,
.artan-crm-field select:focus-visible,
.artan-crm-field textarea:focus-visible,
.artan-crm-consent input:focus-visible,
.artan-crm-submit:focus-visible,
.artan-crm-fallback-link:focus-visible {
  outline: 3px solid var(--artan-crm-charcoal);
  outline-offset: 2px;
}
.artan-crm-field [aria-invalid="true"] { border-color: var(--artan-crm-danger); }
.artan-crm-field__error { min-height: 20px; margin-top: 3px; display: block; color: var(--artan-crm-danger); font-size: 12px; line-height: 1.6; }
.artan-crm-choice-group { margin: 0; padding: 0; border: 0; }
.artan-crm-choice-group legend { margin-bottom: 6px; color: var(--artan-crm-charcoal); font-size: 14px; font-weight: 600; }
.artan-crm-choice-group legend span { color: var(--artan-crm-orange-deep); }
.artan-crm-field__help { margin: 0 0 8px; color: var(--artan-crm-muted); font-size: 12px; }
.artan-crm-choice-group__options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.artan-crm-choice-group__options label { min-height: 44px; padding: 9px 10px; border: 1px solid var(--artan-crm-border); border-radius: 9px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .72); cursor: pointer; }
.artan-crm-choice-group__options input { width: 20px; height: 20px; min-width: 20px; margin: 0; accent-color: var(--artan-crm-orange-deep); }
.artan-crm-choice-group__options input:focus-visible { outline: 3px solid var(--artan-crm-charcoal); outline-offset: 2px; }
.artan-crm-privacy { margin: 0; color: var(--artan-crm-muted); font-size: 13px; line-height: 1.8; }
.artan-crm-privacy a { color: var(--artan-crm-charcoal); text-decoration: underline; text-underline-offset: 3px; }

.artan-crm-consent label { min-height: 44px; margin: 0; display: flex; align-items: flex-start; gap: 10px; color: var(--artan-crm-muted); font-size: 13px; font-weight: 400; cursor: pointer; }
.artan-crm-consent input { width: 20px; height: 20px; min-width: 20px; margin: 3px 0 0; accent-color: var(--artan-crm-orange-deep); }
.artan-crm-submit,
.artan-crm-fallback-link {
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid var(--artan-crm-orange);
  border-radius: 9px;
  color: var(--artan-crm-charcoal);
  background: var(--artan-crm-orange);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 160ms var(--artan-crm-ease), border-color 160ms var(--artan-crm-ease), transform 160ms var(--artan-crm-ease);
}
.artan-crm-submit:hover { border-color: var(--artan-crm-orange-deep); background: var(--artan-crm-orange); transform: translateY(-1px); }
.artan-crm-submit:disabled { cursor: wait; opacity: .68; transform: none; }
.artan-crm-status { min-height: 26px; margin: 12px 0 0; color: var(--artan-crm-danger); font-size: 13px; }
.artan-crm-success { min-height: 300px; padding: 42px 20px; text-align: center; }
.artan-crm-success:focus { outline: 3px solid var(--artan-crm-charcoal); outline-offset: 3px; }
.artan-crm-success__mark { width: 64px; height: 64px; margin: 0 auto 18px; border-radius: 50%; color: #fff; background: var(--green, #7bae3c); display: grid; place-items: center; font-size: 30px; }
.artan-crm-success h3 { margin: 0; font-size: 30px; }
.artan-crm-success p { max-width: 420px; margin: 12px auto 0; color: var(--artan-crm-muted); }
.artan-crm-honeypot { position: absolute !important; right: -10000px !important; width: 1px !important; height: 1px !important; overflow: hidden !important; }

.artan-crm-embed { max-width: 760px; margin: 48px auto; padding: clamp(24px, 5vw, 48px); border: 1px solid var(--artan-crm-border); border-radius: 16px; background: var(--artan-crm-cream); font-family: inherit; }
.artan-crm-embed__title { margin: 0 0 28px; color: var(--artan-crm-charcoal); }

@keyframes artan-crm-enter {
  from { opacity: 0; transform: translateY(12px) scale(.99); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 767px) {
  .artan-crm-dialog { align-items: end; padding: 0; overflow: hidden; }
  .artan-crm-dialog__sheet {
    width: 100%;
    height: 100dvh;
    max-height: 100dvh;
    border-width: 0;
    border-radius: 18px 18px 0 0;
    display: block;
    overflow-y: auto;
    overscroll-behavior: contain;
  }
  .artan-crm-dialog__close { position: fixed; top: max(12px, env(safe-area-inset-top)); left: 12px; background: rgba(43, 43, 43, .72); }
  .artan-crm-dialog__intro { min-height: auto; padding: calc(62px + env(safe-area-inset-top)) 20px 28px; }
  .artan-crm-dialog__intro h2 { padding-left: 38px; font-size: 30px; }
  .artan-crm-dialog__promises { margin: 24px 0 16px; }
  .artan-crm-dialog__response { margin-top: 8px; }
  .artan-crm-dialog__form-panel { max-height: none; overflow: visible; padding: 30px 20px calc(30px + env(safe-area-inset-bottom)); }
  .artan-crm-form__fields { grid-template-columns: minmax(0, 1fr); }
  .artan-crm-field--wide { grid-column: auto; }
  .artan-crm-choice-group__options { grid-template-columns: minmax(0, 1fr); }
  .artan-crm-submit { width: 100%; min-height: 52px; }
  .artan-crm-embed { width: calc(100% - 24px); padding: 24px 16px; }
}

@media (max-width: 360px) {
  .artan-crm-dialog__intro,
  .artan-crm-dialog__form-panel { padding-right: 14px; padding-left: 14px; }
  .artan-crm-field input:not([type="checkbox"]),
  .artan-crm-field select,
  .artan-crm-field textarea { min-width: 0; }
}

@media (prefers-reduced-motion: reduce) {
  .artan-crm-dialog__sheet { animation: none !important; }
  .artan-crm-dialog *,
  .artan-crm-embed * { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
  .artan-crm-dialog__close:hover,
  .artan-crm-submit:hover { transform: none !important; }
}
