/* Single source of truth for card max width */
:root {
  --order-card-max: 560px;
}

/* Order Card - Header Zone */
.order-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  gap: 12px;
  padding: 8px 0 16px 0;
  border-bottom: 1px solid #e2e8f0;
}

.order-card__status {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.order-card__status-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  flex: 0 0 10px;
  box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.03) inset;
}

.order-card__status-label {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #3b82f6;
  /* default brand blue; will vary by status via modifier */
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Stack label + small timestamp */
.order-card__status-texts {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
}

.order-card__status-timestamp {
  font-size: 11px;
  font-weight: 500;
  color: #9ca3af;
  /* gray-400 */
  text-transform: none;
}

.order-card__ref {
  margin-left: auto;
  font-size: 12px;
  font-weight: 500;
  color: #6b7280;
  white-space: nowrap;
}

.order-card__refwrap {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  margin-left: auto;
}

.order-card__client-ref {
  font-size: 11px;
  color: #9ca3af;
  /* gray-400 */
  white-space: nowrap;
}

/* Status color variants (reusing palette accents from clientProfileOrders.css) */
.status--green .order-card__status-label {
  color: #16a34a;
}

.status--green .order-card__status-dot {
  background-color: #22c55e;
}

.status--blue .order-card__status-label {
  color: #2563eb;
}

.status--blue .order-card__status-dot {
  background-color: #3b82f6;
}

.status--orange .order-card__status-label {
  color: #d97706;
}

.status--orange .order-card__status-dot {
  background-color: #f59e0b;
}

.status--red .order-card__status-label {
  color: #dc2626;
}

.status--red .order-card__status-dot {
  background-color: #ef4444;
}

.status--gray .order-card__status-label {
  color: #64748b;
}

.status--gray .order-card__status-dot {
  background-color: #94a3b8;
}

/* Responsive tweaks */
@media (max-width: 480px) {
  .order-card__header {
    padding: 6px 0 12px 0;
    gap: 8px;
  }

  .order-card__status-label {
    font-size: 11px;
  }

  .order-card__status-timestamp {
    font-size: 10.5px;
  }

  .order-card__ref {
    font-size: 11px;
  }

  .order-card__client-ref {
    font-size: 10.5px;
  }
}

/* Languages row (Gemini-style) */
.order-card__langs {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 32px;
  /* spread out more */
  padding: 24px 0 12px 0;
  /* more breathing room */
  width: 100%;
  box-sizing: border-box;
}

.order-card__lang {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.order-card__lang--right {
  align-items: flex-end;
}

.order-card__lang-code {
  font-size: 32px;
  line-height: 1;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #111827;
  /* near-black for contrast */
}

.order-card__lang-name {
  font-size: 13px;
  color: #6b7280;
  /* gray-500 */
}

.order-card__lang-arrow {
  font-size: 32px;
  /* larger arrow */
  color: #7c8593;
  /* slightly darker for visibility */
  font-weight: 700;
}

@media (max-width: 480px) {
  .order-card__langs {
    gap: 20px;
    padding: 16px 0 10px 0;
  }

  .order-card__lang-code {
    font-size: 28px;
  }

  .order-card__lang-name {
    font-size: 12px;
  }

  .order-card__lang-arrow {
    font-size: 26px;
  }
}

/* Status info block (Gemini-style) */
.order-card__statusinfo {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7f9fc;
  margin: 10px 0 4px;
  width: 100%;
  box-sizing: border-box;
}

.order-card__statusinfo-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  color: #1f3a5f;
  background: #e6eef8;
  line-height: 1;
}

.order-card__statusinfo-content {
  min-width: 0;
}

.order-card__statusinfo-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #6b778c;
  margin-bottom: 4px;
}

.order-card__statusinfo-text {
  margin: 0;
  color: #1c1e21;
  font-size: 14px;
  line-height: 1.5;
}

/* Color variants align to header */
.order-card__statusinfo.status--blue {
  background: #f1f6ff;
}

.order-card__statusinfo.status--blue .order-card__statusinfo-icon {
  background: #e2edff;
  color: #1e40af;
}

.order-card__statusinfo.status--green {
  background: #eef9f1;
}

.order-card__statusinfo.status--green .order-card__statusinfo-icon {
  background: #dbf1e1;
  color: #11663a;
}

.order-card__statusinfo.status--yellow {
  background: #fffbeb;
}

.order-card__statusinfo.status--yellow .order-card__statusinfo-icon {
  background: #fef3c7;
  color: #92400e;
}

.order-card__statusinfo.status--purple {
  background: #f5f3ff;
}

.order-card__statusinfo.status--purple .order-card__statusinfo-icon {
  background: #ede9fe;
  color: #4c1d95;
}

.order-card__statusinfo.status--orange {
  background: #fff7e8;
}

.order-card__statusinfo.status--orange .order-card__statusinfo-icon {
  background: #ffecc8;
  color: #8a5a00;
}

.order-card__statusinfo.status--red {
  background: #fff0f0;
}

.order-card__statusinfo.status--red .order-card__statusinfo-icon {
  background: #ffd9d9;
  color: #8a1f1f;
}

.order-card__duplicate-badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin: 0 0 8px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff7e8;
  color: #8a5a00;
  border: 1px solid #ffe0a3;
  font-size: 12px;
  font-weight: 700;
}

.order-card__duplicate-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}

.order-card__duplicate-actions .delete-order-button,
.order-card__duplicate-actions .not-duplicate-button {
  margin-top: 0 !important;
  min-width: 130px !important;
}

.not-duplicate-button {
  background: #1f6feb;
  color: #ffffff;
  border: none;
  border-radius: 12px;
  padding: 12px 20px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

.not-duplicate-button:hover {
  background: #185abc;
}

.order-card__duplicate-fineprint {
  margin: 8px 0 0;
  color: #5f6b7a;
  font-size: 11px;
  line-height: 1.45;
}

.order-card__apostille-originals-status {
  border: 1px solid #ddd6fe;
  background: #f7f4ff;
}

.order-card__apostille-originals-status .order-card__statusinfo-icon {
  background: #ede9fe;
  color: #4c1d95;
}

@media (max-width: 520px) {
  .order-card__statusinfo {
    padding: 10px 12px;
    gap: 10px;
  }

  .order-card__statusinfo-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .order-card__statusinfo-title {
    font-size: 11px;
  }

  .order-card__statusinfo-text {
    font-size: 13px;
  }
}

/* Next steps panel */
.order-card__panel {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 12px;
  align-items: start;
  padding: 12px 14px;
  border-radius: 10px;
  background: #f7fdf9;
  /* soft greenish to indicate progress */
  border: 1px solid #e5f4ea;
  margin: 10px 0;
  width: 100%;
  box-sizing: border-box;
}

.order-card__panel-icon {
  display: inline-flex;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  color: #14532d;
  /* deep green */
  background: #dcfce7;
  /* green-100 */
  line-height: 1;
}

.order-card__panel-content {
  min-width: 0;
}

.order-card__panel-title {
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: #256f43;
  margin-bottom: 6px;
}

.order-card__panel-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 8px;
}

.order-card__panel-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: start;
}

.order-card__panel-item-icon {
  display: inline-flex;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 12px;
  color: #14532d;
  background: #e9f9ef;
}

.order-card__panel-item-text {
  color: #1c1e21;
  font-size: 13px;
  line-height: 1.45;
}

.order-card__panel-item.apostille-text .order-card__panel-item-icon {
  background: #e9f9ef;
}

.order-card__panel-item.evaluation-text .order-card__panel-item-icon {
  background: #e9f1ff;
  color: #1e3a8a;
}

.order-card__panel-item.notary-text .order-card__panel-item-icon {
  background: #fff7e8;
  color: #8a5a00;
}

.order-card__panel-item.shipping-text .order-card__panel-item-icon {
  background: #f1f5f9;
  color: #0f172a;
}

@media (max-width: 520px) {
  .order-card__panel {
    padding: 10px 12px;
    gap: 10px;
  }

  .order-card__panel-icon {
    width: 24px;
    height: 24px;
    font-size: 12px;
  }

  .order-card__panel-title {
    font-size: 11px;
  }

  .order-card__panel-item-text {
    font-size: 12.5px;
  }
}


.get-ai-quote-button {
  margin-top: 14px;
  background: #2563eb;
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 10px 14px;
  font-weight: 600;
  font-size: 14px;
  letter-spacing: .02em;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(37, 99, 235, 0.25);
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease;
}

.get-ai-quote-button:hover {
  background: #1d4ed8;
  box-shadow: 0 3px 10px rgba(29, 78, 216, 0.3);
}

.get-ai-quote-button:active {
  transform: translateY(1px);
}

.get-ai-quote-button:focus {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

.get-ai-quote-button[disabled] {
  opacity: .6;
  cursor: not-allowed;
  box-shadow: none;
}

/* CTA wrapper aligns the button nicely within the card */
.order-card__cta {
  display: flex;
  justify-content: center;
  margin: 8px 0 2px;
}

@media (max-width: 520px) {
  .order-card__cta {
    margin: 6px 0 0;
  }

  .get-ai-quote-button {
    width: 100%;
    max-width: 100%;
    padding: 12px 14px;
    font-size: 15px;
  }
}


/* Payment toggle button spanning the card */
.order-card__toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 10px !important;
  width: 100% !important;
  box-sizing: border-box !important;
  border: none !important;
  /* blue gradient to match "Continue to Pay" */
  background: linear-gradient(90deg, #3b82f6, #2563eb) !important;
  color: #ffffff !important;
  border-radius: 12px !important;
  padding: 14px 16px !important;
  font-weight: 700 !important;
  font-size: 16px !important;
  letter-spacing: .01em !important;
  text-align: center !important;
  cursor: pointer !important;
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.25) !important;
  transition: background .15s ease, box-shadow .15s ease, transform .05s ease !important;
}

.order-card__toggle:hover {
  background: linear-gradient(90deg, #2563eb, #1d4ed8) !important;
  box-shadow: 0 10px 22px rgba(29, 78, 216, 0.32) !important;
}

.order-card__toggle:active {
  transform: translateY(1px) !important;
}

.order-card__toggle:focus {
  outline: 2px solid #93c5fd !important;
  outline-offset: 2px !important;
}

.order-card__toggle[aria-expanded="true"] {
  background: linear-gradient(90deg, #1d4ed8, #1e40af) !important;
}

.order-card__toggle-icon {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 20px !important;
  height: 20px !important;
  font-size: 16px !important;
}

.order-card__toggle-text {
  line-height: 1 !important;
}

/* Place some spacing around it similar to other blocks */
.order-card__toggle-wrap {
  margin: 12px 0;
  width: 100%;
}

/* Narrower order cards */
.order-div,
.order-div-2 {
  max-width: var(--order-card-max) !important;
  /* match preview width more closely */
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* Ensure the outer wrapper matches the same width so all cards are identical */
.order-listItem {
  max-width: var(--order-card-max) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
  min-width: 0 !important;
}

/* Ensure the inner details container can also expand */
.order-details-div {
  max-width: var(--order-card-max) !important;
  width: 100% !important;
  margin-left: auto !important;
  margin-right: auto !important;
  box-sizing: border-box !important;
}

/* On narrower screens, switch to full width and neutralize max constraints */
@media (max-width: 740px) {
  :root {
    --order-card-max: 100vw;
  }

  .order-div,
  .order-div-2,
  .order-listItem,
  .order-details-div {
    max-width: 100% !important;
    width: 100% !important;
  }

  /* ensure no stray margins from older rules push cards to the right */
  .order-div,
  .order-div-2,
  .order-listItem,
  .order-details-div {
    margin-left: auto !important;
    margin-right: auto !important;
  }
}

/* Prevent child content from widening the card: allow wrapping and shrinking */
.order-card__header,
.order-card__langs,
.order-card__statusinfo,
.order-card__panel,
.order-details-div {
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.order-card__status,
.order-card__refwrap,
.order-card__statusinfo-content,
.order-card__panel-content {
  min-width: 0;
}

/* Wrap long words/URLs within textual areas */
.order-card__status-label,
.order-card__status-timestamp,
.order-card__ref,
.order-card__client-ref,
.order-card__statusinfo-text,
.order-card__panel-item-text {
  white-space: normal;
  overflow-wrap: anywhere;
  /* prefer wrapping over overflow */
  word-break: break-word;
  /* fallback for older engines */
  hyphens: auto;
}

/* Countdown - modern pill */
.countdown {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px;
  border-radius: 9999px;
  /* pill */
  background: #f8fafc;
  /* slate-50 */
  border: 1px solid #e5e7eb;
  /* gray-200 */
  color: #0f172a;
  /* slate-900 */
  font-size: 16px;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.countdown::before {
  content: "⏳";
  display: inline-block;
  width: 18px;
  height: 18px;
  font-size: 16px;
  line-height: 18px;
  text-align: center;
  color: #334155;
  /* slate-700 */
}

.countdown-span {
  font-weight: 700;
  letter-spacing: .02em;
  color: linear-gradient(90deg, #3b82f6, #06b6d4);
  /* blue → cyan */
  background: linear-gradient(90deg, #3b82f6, #06b6d4) !important;
  /* blue → cyan */
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;


}

.countdown-time {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  color: #0f172a;
}

/* Expired state */
.countdown.is-expired {
  background: #fef2f2;
  /* red-50 */
  border-color: #fecaca;
  /* red-200 */
  color: #991b1b;
  /* red-800 */
}

.countdown.is-expired::before {
  content: "⌛";
  color: #991b1b;
}

.countdown.is-expired .countdown-span {
  background: linear-gradient(90deg, #ef4444, #f97316) !important;
  /* red → orange */
  background-clip: text !important;
  -webkit-background-clip: text !important;
  -webkit-text-fill-color: transparent !important;
}

@media (max-width: 520px) {
  .countdown {
    font-size: 15px;
    padding: 6px 10px;
    gap: 8px;
  }

  .countdown::before {
    font-size: 15px;
    width: 16px;
    height: 16px;
    line-height: 16px;
  }
}

/* XS full-bleed card widths with small gutters */
@media (max-width: 420px) {
  :root {
    --order-card-max: 100vw;
  }

  #order-list {
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 8px !important;
  }

  .order-listItem,
  .order-div,
  .order-div-2,
  .order-details-div {
    width: 100% !important;
    max-width: none !important;
  }
}