/**
 * Contact page (template-contact.php): "Submit a ticket" / "Track my ticket" forms and
 * the ticket detail view. Dark, readable text on light cards throughout — no chat
 * bubbles, no floating widget. Loaded only on the Contact page template
 * (inc/hooks/legal-hooks.php enqueues it alongside dripex-legal.css).
 */

.dxs-ticket-wrap { max-width: 900px; padding: 44px 24px 80px; }

/* --- notices --------------------------------------------------------------- */
.dxs-ticket-notice {
  margin: 0 0 24px;
  padding: 14px 18px;
  border-radius: 12px;
  border: 1px solid;
  font-size: 14px;
  line-height: 1.55;
  font-weight: 600;
}
.dxs-ticket-notice--success { background: #ECFDF5; border-color: #A7F3D0; color: #065F46; }
.dxs-ticket-notice--error { background: #FEF2F2; border-color: #FECACA; color: #991B1B; }

/* --- submit + track cards --------------------------------------------------- */
.dxs-ticket-columns {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 20px;
  align-items: start;
}

.dxs-ticket-card {
  padding: 28px 26px;
  border: 1px solid #E2E8F0;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05);
}
.dxs-ticket-card h2 { margin: 0 0 6px; color: #0D1B3E; font-size: 18px; font-weight: 800; }
.dxs-ticket-card__intro { margin: 0 0 18px; color: #475569; font-size: 13.5px; line-height: 1.6; }
.dxs-ticket-card--track { background: #F8FAFC; }

.dxs-ticket-form { display: flex; flex-direction: column; gap: 4px; }
.dxs-ticket-form label { margin: 10px 0 2px; color: #0D1B3E; font-size: 12.5px; font-weight: 700; }
.dxs-ticket-form label:first-child { margin-top: 0; }
.dxs-ticket-form input,
.dxs-ticket-form textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  color: #0F172A;
  font-size: 14px;
  font-family: inherit;
}
.dxs-ticket-form input:focus,
.dxs-ticket-form textarea:focus { outline: none; border-color: var(--color-blue, #2F6FED); box-shadow: 0 0 0 3px rgba(47, 111, 237, .16); }
.dxs-ticket-form textarea { resize: vertical; min-height: 110px; }

/* Spam protection (inc/support/spam-guard.php): the honeypot sits far off-screen (not display:none, which bots skip) and the
   Cloudflare Turnstile box keeps its height while it loads so the button does not jump. */
.dxs-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.dxs-turnstile { min-height: 65px; margin: 12px 0 4px; }
.dxs-turnstile__nojs { margin: 0; color: #991B1B; font-size: 13px; font-weight: 600; }

.dxs-ticket-submit {
  align-self: flex-start;
  margin-top: 18px;
  padding: 12px 22px;
  border: 1px solid var(--color-blue, #2F6FED);
  border-radius: 10px;
  background: var(--color-blue, #2F6FED);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color .15s ease, transform .15s ease;
}
.dxs-ticket-submit:hover { background: #2660d1; transform: translateY(-1px); }
.dxs-ticket-submit--ghost { background: #fff; color: var(--color-blue, #2F6FED); }
.dxs-ticket-submit--ghost:hover { background: #DBEAFE; border-color: var(--color-blue, #2F6FED); color: #1E4FC4; }

.dxs-ticket-forgot { margin-top: 16px; }
.dxs-ticket-forgot summary { color: #475569; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.dxs-ticket-form--inline { flex-direction: row; gap: 8px; margin-top: 10px; }
.dxs-ticket-form--inline input { flex: 1; }
.dxs-ticket-form--inline .dxs-ticket-submit { margin-top: 0; padding: 10px 16px; font-size: 12.5px; }

/* --- trust points + policy links (shared look with the old CTA card) -------- */
.dxs-contact-points {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}
.dxs-contact-points li {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 18px 12px;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  color: #1E293B;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
}

.dxs-contact-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px 20px;
  margin: 32px 0 0;
  padding-top: 24px;
  border-top: 1px solid #E2E8F0;
}
.dxs-contact-links a { color: #475569; font-size: 13.5px; font-weight: 600; text-decoration: underline; }
.dxs-contact-links a:hover { color: var(--color-blue, #2F6FED); }

/* --- ticket detail view ------------------------------------------------------ */
.dxs-ticket-detail__head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}
.dxs-ticket-detail__meta { color: #64748B; font-size: 13px; }
.dxs-ticket-newlink { margin-left: auto; color: var(--color-blue, #2F6FED); font-size: 13px; font-weight: 700; text-decoration: underline; }

.dxs-ticket-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .02em;
}
.dxs-ticket-pill--open { background: #DBEAFE; color: #1E40AF; }
.dxs-ticket-pill--closed { background: #F1F5F9; color: #64748B; }

.dxs-ticket-thread { display: flex; flex-direction: column; gap: 12px; margin-bottom: 20px; }

.dxs-ticket-msg {
  padding: 14px 18px;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  background: #fff;
}
.dxs-ticket-msg--admin { background: #F0F6FF; border-color: #DBEAFE; }
.dxs-ticket-msg header { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.dxs-ticket-msg strong { color: #0D1B3E; font-size: 13.5px; font-weight: 800; }
.dxs-ticket-msg time { color: #64748B; font-size: 11.5px; }
.dxs-ticket-msg p { margin: 0; color: #1E293B; font-size: 14px; line-height: 1.6; white-space: pre-line; }

.dxs-ticket-reply {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 18px;
  border: 1px solid #E2E8F0;
  border-radius: 14px;
  background: #F8FAFC;
}
.dxs-ticket-reply textarea {
  width: 100%;
  padding: 11px 13px;
  border: 1px solid #CBD5E1;
  border-radius: 10px;
  background: #fff;
  color: #0F172A;
  font-size: 14px;
  font-family: inherit;
  resize: vertical;
}
.dxs-ticket-reply textarea:focus { outline: none; border-color: var(--color-blue, #2F6FED); box-shadow: 0 0 0 3px rgba(47, 111, 237, .16); }
.dxs-ticket-reply button {
  align-self: flex-end;
  padding: 10px 20px;
  border: 0;
  border-radius: 10px;
  background: var(--color-blue, #2F6FED);
  color: #fff;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}
.dxs-ticket-reply button:hover { background: #2660d1; }

/* --- responsive -------------------------------------------------------------- */
@media (max-width: 800px) {
  .dxs-ticket-columns { grid-template-columns: 1fr; }
  .dxs-contact-points { grid-template-columns: 1fr; }
}
/* Turnstile is at least 300px wide; on the narrowest phones the card is narrower than that, so the widget is scaled down to fit. */
@media (max-width: 380px) { .dxs-turnstile { zoom: .88; } }
@media (max-width: 340px) { .dxs-turnstile { zoom: .8; } }
@media (max-width: 480px) {
  .dxs-ticket-wrap { padding: 32px 16px 60px; }
  .dxs-ticket-card { padding: 22px 18px; }
  .dxs-ticket-newlink { margin-left: 0; }
}
