.tcf-wrap {
  width: 100%;
  max-width: 900px;
  margin: 32px auto;
  box-sizing: border-box;
}

.tcf-wrap *, .tcf-wrap *::before, .tcf-wrap *::after {
  box-sizing: border-box;
}

.tcf-card {
  background: #fff;
  border: 1px solid rgba(30, 41, 59, .10);
  border-radius: 24px;
  padding: clamp(22px, 4vw, 42px);
  box-shadow: 0 20px 60px rgba(15, 23, 42, .10);
}

.tcf-header {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  margin-bottom: 26px;
}

.tcf-icon {
  display: grid;
  place-items: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: linear-gradient(135deg, #7c3aed, #4f46e5);
  color: #fff;
  font-size: 23px;
  box-shadow: 0 10px 25px rgba(79, 70, 229, .28);
}

.tcf-header h2 {
  margin: 0 0 7px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.18;
  color: #172033;
}

.tcf-header p {
  margin: 0;
  color: #667085;
  line-height: 1.6;
}

.tcf-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.tcf-field {
  margin-bottom: 18px;
}

.tcf-field label {
  display: block;
  margin-bottom: 8px;
  color: #344054;
  font-weight: 700;
  font-size: 14px;
}

.tcf-field label span,
.tcf-consent b {
  color: #dc2626;
}

.tcf-field input,
.tcf-field textarea {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 13px;
  padding: 13px 14px;
  background: #fff;
  color: #172033;
  font: inherit;
  outline: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}

.tcf-field textarea {
  resize: vertical;
  min-height: 150px;
}

.tcf-field input:focus,
.tcf-field textarea:focus {
  border-color: #6d5dfc;
  box-shadow: 0 0 0 4px rgba(109, 93, 252, .12);
}

.tcf-field small {
  display: block;
  margin-top: 7px;
  color: #667085;
}

.tcf-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 5px 0 22px;
  color: #475467;
  line-height: 1.45;
  cursor: pointer;
}

.tcf-consent input {
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: #5b4df5;
}

.tcf-submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  min-height: 52px;
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  background: linear-gradient(135deg, #6d5dfc, #4f46e5);
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 12px 30px rgba(79, 70, 229, .25);
  transition: transform .2s, box-shadow .2s, filter .2s;
}

.tcf-submit:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(79, 70, 229, .30);
  filter: brightness(1.03);
}

.tcf-submit:focus-visible {
  outline: 3px solid rgba(79, 70, 229, .25);
  outline-offset: 3px;
}

.tcf-alert {
  border-radius: 14px;
  padding: 14px 16px;
  margin: 0 0 22px;
  line-height: 1.5;
}

.tcf-success {
  background: #ecfdf3;
  border: 1px solid #abefc6;
  color: #067647;
}

.tcf-error {
  background: #fef3f2;
  border: 1px solid #fecdca;
  color: #b42318;
}

.tcf-honeypot {
  position: absolute !important;
  left: -10000px !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
}

@media (max-width: 700px) {
  .tcf-grid {
    grid-template-columns: 1fr;
    gap: 0;
  }

  .tcf-card {
    border-radius: 18px;
  }

  .tcf-header {
    align-items: center;
  }

  .tcf-submit {
    width: 100%;
  }
}

.tcf-field select {
  width: 100%;
  min-height: 50px;
  border: 1px solid #d0d5dd;
  border-radius: 13px;
  padding: 12px 42px 12px 14px;
  background-color: #fff;
  color: #172033;
  font: inherit;
  outline: none;
  cursor: pointer;
  transition: border-color .2s, box-shadow .2s;
}

.tcf-field select:focus {
  border-color: #6d5dfc;
  box-shadow: 0 0 0 4px rgba(109, 93, 252, .12);
}

.tcf-order-box {
  margin: 4px 0 22px;
  padding: 20px;
  border: 1px solid #ddd6fe;
  border-radius: 18px;
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
}

.tcf-order-heading {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin-bottom: 16px;
}

.tcf-order-heading > span {
  display: grid;
  place-items: center;
  flex: 0 0 42px;
  width: 42px;
  height: 42px;
  border-radius: 13px;
  background: #fff;
  font-size: 21px;
  box-shadow: 0 7px 18px rgba(79, 70, 229, .12);
}

.tcf-order-heading h3 {
  margin: 0 0 4px;
  color: #35246f;
  font-size: 19px;
  line-height: 1.3;
}

.tcf-order-heading p {
  margin: 0;
  color: #625b7c;
  line-height: 1.5;
}

.tcf-order-box .tcf-field {
  margin-bottom: 0;
}

/* Защищённый диалог клиента */
body.tcf-chat-page {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(145deg, #f5f3ff 0%, #eef2ff 45%, #f8fafc 100%);
  color: #172033;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tcf-chat-page *, .tcf-chat-page *::before, .tcf-chat-page *::after {
  box-sizing: border-box;
}

.tcf-chat-shell {
  width: 100%;
  max-width: 980px;
  margin: 0 auto;
  padding: 34px 18px;
}

.tcf-chat-card {
  overflow: hidden;
  border: 1px solid rgba(30, 41, 59, .10);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 24px 70px rgba(15, 23, 42, .12);
}

.tcf-chat-header {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 24px 26px;
  border-bottom: 1px solid #eaecf0;
  background: linear-gradient(135deg, #faf5ff, #eef2ff);
}

.tcf-chat-logo {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  background: #fff;
  font-size: 25px;
  box-shadow: 0 9px 22px rgba(79, 70, 229, .15);
}

.tcf-chat-kicker {
  margin: 0 0 3px !important;
  color: #6d28d9;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tcf-chat-header h1 {
  margin: 0 0 5px;
  color: #172033;
  font-size: clamp(23px, 4vw, 32px);
  line-height: 1.2;
}

.tcf-chat-header p:last-child {
  margin: 0;
  color: #667085;
}

.tcf-chat-status {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  border-radius: 999px;
  padding: 5px 11px;
  background: #ecfdf3;
  color: #067647;
  font-size: 13px;
  font-weight: 800;
}

.tcf-chat-card > .tcf-alert {
  margin: 20px 24px 0;
}

.tcf-chat-security {
  margin: 20px 24px 0;
  border: 1px solid #d0d5dd;
  border-radius: 12px;
  padding: 11px 13px;
  background: #f9fafb;
  color: #475467;
  font-size: 13px;
}

.tcf-client-thread {
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-height: 560px;
  overflow-y: auto;
  padding: 24px;
  scroll-behavior: smooth;
}

.tcf-client-message {
  width: min(82%, 700px);
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 5px 16px rgba(15, 23, 42, .05);
}

.tcf-client-message-client {
  align-self: flex-end;
  border: 1px solid #c7d2fe;
  border-bottom-right-radius: 6px;
  background: #eef2ff;
}

.tcf-client-message-admin {
  align-self: flex-start;
  border: 1px solid #e5e7eb;
  border-bottom-left-radius: 6px;
  background: #f8fafc;
}

.tcf-client-message-meta {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 6px;
  font-size: 13px;
}

.tcf-client-message-meta span {
  color: #667085;
  font-size: 12px;
  white-space: nowrap;
}

.tcf-client-message-subject {
  margin-bottom: 6px;
  font-weight: 800;
}

.tcf-client-message-body {
  color: #344054;
  line-height: 1.62;
  word-break: break-word;
}

.tcf-client-reply {
  border-top: 1px solid #eaecf0;
  padding: 22px 24px 24px;
  background: #fff;
}

.tcf-client-reply > label {
  display: block;
  margin-bottom: 9px;
  color: #344054;
}

.tcf-client-reply textarea {
  width: 100%;
  min-height: 130px;
  margin-bottom: 14px;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  padding: 13px 14px;
  color: #172033;
  font: inherit;
  resize: vertical;
  outline: none;
}

.tcf-client-reply textarea:focus {
  border-color: #6d5dfc;
  box-shadow: 0 0 0 4px rgba(109, 93, 252, .12);
}

.tcf-chat-footer {
  border-top: 1px solid #eaecf0;
  padding: 14px 24px;
  text-align: center;
  background: #f9fafb;
}

.tcf-chat-footer a, .tcf-chat-home {
  color: #4f46e5;
  font-weight: 700;
  text-decoration: none;
}

@media (max-width: 700px) {
  .tcf-chat-shell { padding: 12px; }
  .tcf-chat-card { border-radius: 17px; }
  .tcf-chat-header { grid-template-columns: auto 1fr; padding: 20px 18px; }
  .tcf-chat-status { grid-column: 1 / -1; justify-self: start; }
  .tcf-client-thread { padding: 18px 14px; }
  .tcf-client-message { width: 92%; }
  .tcf-client-message-meta { align-items: flex-start; flex-direction: column; gap: 2px; }
  .tcf-client-reply { padding: 18px 14px; }
}
