:root {
  color-scheme: light;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f8fafc 0%, #eef3ff 100%);
  color: #0f172a;
}

.page-shell {
  width: 100%;
  flex: 1;
  padding: clamp(16px, 4vw, 32px) 0 40px;
}

.order-check-layout {
  width: min(1080px, 100% - clamp(24px, 8vw, 120px));
  margin: 14px auto 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 420px);
  gap: clamp(20px, 4vw, 40px);
  align-items: start;
}

.order-check-intro {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.24);
  border-radius: 20px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.06);
  padding: clamp(22px, 4vw, 34px);
  backdrop-filter: blur(10px);
}

.order-check-eyebrow {
  margin: 0 0 12px;
  color: #2563eb;
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.order-check-title {
  margin: 0 0 12px;
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  line-height: 1.1;
}

.order-check-text {
  margin: 0;
  color: #475569;
  font-size: 1rem;
  line-height: 1.7;
  max-width: 60ch;
}

.order-check-widget-wrap {
  min-width: 0;
}

[hidden] {
  display: none !important;
}

#order-status-widget {
  --bg: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --stroke: rgba(148, 163, 184, 0.35);
  --accent: #2563eb;
  --accent-soft: rgba(37, 99, 235, 0.15);
  --radius: 20px;
  color: var(--text);
  font-family: inherit;
}

.widget-shell {
  background: var(--bg);
  border-radius: var(--radius);
  border: 1px solid var(--stroke);
  box-shadow: 0 15px 35px rgba(15, 23, 42, 0.08);
  padding: clamp(16px, 3vw, 28px);
  margin: 0 auto;
  position: relative;
}

.card {
  border-radius: calc(var(--radius) - 4px);
  border: 1px solid var(--stroke);
  padding: clamp(16px, 2.5vw, 24px);
  margin-bottom: clamp(16px, 2vw, 24px);
  background: linear-gradient(135deg, rgba(248, 250, 252, 0.85), rgba(255, 255, 255, 0.95));
  backdrop-filter: blur(5px);
}

.card:last-of-type {
  margin-bottom: 0;
}

#resultCard {
  min-height: 180px;
  max-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.label {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.card > .label {
  margin-bottom: 8px;
}

.value {
  margin: 0;
  color: var(--text);
  font-size: clamp(1.1rem, 3vw, 1.35rem);
  font-weight: 600;
  line-height: 1.3;
}

.hint {
  margin: 16px 0 0;
  color: var(--muted);
  opacity: 0.8;
  font-size: 0.9rem;
  line-height: 1.5;
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 140px;
  min-height: 42px;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.status-badge {
  box-shadow: inset 0 0 0 1px rgba(15, 23, 42, 0.06);
}

.status-new,
.status-cancelled {
  background: rgba(148, 163, 184, 0.2);
  color: #475569;
}

.status-empty {
  background: rgba(148, 163, 184, 0.18);
  color: #64748b;
}

.status-processing {
  background: rgba(56, 189, 248, 0.2);
  color: #0284c7;
}

.status-not-found,
.status-refund {
  background: rgba(251, 191, 36, 0.2);
  color: #b45309;
}

.status-completed {
  background: rgba(34, 197, 94, 0.2);
  color: #16a34a;
}

.status-pending {
  background: rgba(250, 204, 21, 0.2);
  color: #a16207;
}

.status-clarification,
.status-failed {
  background: rgba(239, 68, 68, 0.2);
  color: #b91c1c;
}

.status-redirected {
  background: rgba(129, 140, 248, 0.2);
  color: #4f46e5;
}

.status-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 16px;
}

.status-input {
  border: 1px solid var(--stroke);
  border-radius: 12px;
  padding: 14px 16px;
  font-size: 1rem;
  color: var(--text);
  background: #fff;
  transition: all 0.2s ease;
}

.status-input:focus {
  outline: 2px solid rgba(37, 99, 235, 0.35);
  outline-offset: 1px;
  border-color: var(--accent);
}

.status-button {
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 14px 20px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
}

.status-button:hover {
  opacity: 0.92;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.25);
}

.status-button:focus-visible {
  outline: 2px solid rgba(37, 99, 235, 0.5);
  outline-offset: 2px;
}

.status-button:active {
  transform: translateY(0);
}

.result-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.15);
}

.result-row:last-of-type {
  margin-bottom: 16px;
  padding-bottom: 0;
  border-bottom: none;
}

.result-empty {
  padding: 18px 10px;
  color: var(--muted);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
}

.result-details[hidden] {
  display: none !important;
}

.widget-loader,
.widget-error {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 200px;
  text-align: center;
}

.widget-loader {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(2px);
}

.widget-shell.is-loading .widget-content {
  opacity: 0.4;
  pointer-events: none;
}

.widget-error button {
  border: none;
  border-radius: 999px;
  padding: 10px 22px;
  background: var(--accent);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
}

.widget-error button:focus-visible,
.widget-error button:hover {
  opacity: 0.9;
}

.spinner {
  width: 32px;
  height: 32px;
  border: 3px solid rgba(37, 99, 235, 0.2);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (prefers-reduced-motion: reduce) {
  .status-input,
  .status-button,
  .spinner {
    transition: none;
    animation: none;
  }
}

@media (max-width: 900px) {
  .order-check-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 420px) {
  .order-check-layout {
    width: min(1080px, 100% - 24px);
  }

  .widget-shell {
    border-radius: 16px;
    padding: 16px;
  }

  .card {
    padding: 16px;
    border-radius: 14px;
  }

  .status-form {
    gap: 12px;
    margin-top: 14px;
  }

  .status-input {
    padding: 12px 14px;
  }

  .status-button {
    padding: 12px 18px;
  }

  .result-row {
    gap: 12px;
    margin-bottom: 14px;
    padding-bottom: 14px;
  }

  .badge {
    min-width: 120px;
    min-height: 40px;
    padding: 8px 14px;
    font-size: 0.95rem;
  }
}
