@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;900&display=swap');

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --color-berkheimer-blue: #002855;
  --color-vintage-blue: #1e71b8;
  --color-vintage-red: #cc2229;
  --color-berkey-blue: #6699c2;
  --color-bg: #f5f7fa;
  --color-surface: #ffffff;
  --color-text: #002855;
  --color-muted: #5a6a7a;
  --color-active: #1e71b8;
  --color-active-light: #e8f1fa;
  --color-complete: #002855;
  --color-complete-light: #e0e8f0;
  --color-border: #d1d9e2;
  --color-error: #cc2229;
  --color-error-light: #fef2f2;
  --radius: 12px;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-weight: 500;
  background: var(--color-bg);
  color: var(--color-text);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 2rem 1rem;
}

.container {
  width: 100%;
  max-width: 480px;
}

.header {
  text-align: center;
  margin-bottom: 2rem;
}

.header-logo {
  display: block;
  width: 160px;
  height: auto;
  margin: 0 auto 1rem;
}

.header h1 {
  font-family: 'Inter', Arial Black, Arial, sans-serif;
  font-weight: 900;
  font-size: 1.5rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--color-berkheimer-blue);
}

/* States */
.state {
  background: var(--color-surface);
  border-radius: var(--radius);
  padding: 2rem 1.5rem;
  text-align: center;
  box-shadow: 0 1px 3px rgba(0, 40, 85, 0.08), 0 4px 12px rgba(0, 40, 85, 0.04);
  border: 1px solid rgba(0, 40, 85, 0.06);
  animation: fadeIn 0.3s ease-out;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

.hidden {
  display: none;
}

/* Loading */
.spinner {
  width: 36px;
  height: 36px;
  border: 3px solid var(--color-border);
  border-top-color: var(--color-vintage-blue);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 1rem;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

#loading p {
  color: var(--color-muted);
  font-size: 0.95rem;
  font-weight: 500;
}

/* Error */
.error-icon {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--color-error-light);
  color: var(--color-error);
  font-size: 1.5rem;
  font-weight: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
}

#error-message {
  color: var(--color-muted);
  font-size: 0.95rem;
}

/* Order status */
.order-label {
  font-size: 0.9rem;
  color: var(--color-muted);
  margin-bottom: 1.5rem;
}

#order-number {
  font-weight: 600;
  color: var(--color-berkheimer-blue);
}

/* Vertical tracker */
.tracker {
  display: flex;
  flex-direction: column;
  gap: 0;
  text-align: left;
  padding-left: 1rem;
}

.tracker-step {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  position: relative;
  padding: 0.75rem 0;
}

/* Connecting line between dots */
.tracker-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 7px;
  top: calc(0.75rem + 16px);
  bottom: -0.75rem;
  width: 2px;
  background: var(--color-border);
}

.tracker-step.complete:not(:last-child)::after {
  background: var(--color-berkheimer-blue);
}

.step-dot {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  border: 2px solid var(--color-border);
  background: var(--color-surface);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}

.step-label {
  font-size: 0.9rem;
  color: var(--color-muted);
  font-weight: 500;
}

/* Complete step */
.tracker-step.complete .step-dot {
  border-color: var(--color-berkheimer-blue);
  background: var(--color-berkheimer-blue);
}

.tracker-step.complete .step-label {
  color: var(--color-berkheimer-blue);
}

/* Active (current) step */
.tracker-step.active .step-dot {
  border-color: var(--color-vintage-blue);
  background: var(--color-vintage-blue);
  box-shadow: 0 0 0 4px var(--color-active-light);
  animation: pulse 2s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px var(--color-active-light); }
  50% { box-shadow: 0 0 0 7px rgba(30, 113, 184, 0.1); }
}

.tracker-step.active .step-label {
  color: var(--color-vintage-blue);
  font-weight: 600;
}

/* Complete step checkmark */
.tracker-step.complete .step-dot::after {
  content: "";
  display: block;
  width: 5px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin: 1px auto 0;
}

/* Footer */
.footer {
  margin-top: 2rem;
  text-align: center;
  color: var(--color-muted);
  font-size: 0.75rem;
  opacity: 0.7;
}

.footer a {
  color: var(--color-muted);
  text-decoration: none;
}

.footer a:hover {
  text-decoration: underline;
}

/* Responsive tweaks */
@media (min-width: 480px) {
  .state {
    padding: 2.5rem 2rem;
  }

  .header h1 {
    font-size: 1.75rem;
  }

  .header-logo {
    width: 180px;
  }
}
