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

:root {
  --bg:           #f0f0f0;
  --bg-white:     #ffffff;
  --bg-dark:      #1e1e1e;
  --accent:       #2e8fa8;
  --accent-hover: #246d82;
  --text:         #1a1a1a;
  --text-light:   #555555;
  --text-white:   #ffffff;
  --border:       #d0d0d0;
  --radius:       12px;
  --radius-pill:  50px;
  --shadow:       0 2px 12px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 20px rgba(0,0,0,0.12);
}

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

html { overflow-x: hidden; }
body {
  font-family: 'Inter', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  max-width: 100vw;
  overflow-x: hidden;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); text-decoration: underline; }

/* ── Layout ─────────────────────────────────────────────────────── */
.page-wrap {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px 48px;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-dark);
  padding: 16px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.site-brand {
  text-decoration: none;
  display: flex;
  align-items: center;
}
.site-logo {
  height: 44px;
  width: auto;
  display: block;
}
.header-nav { display: flex; align-items: center; gap: 16px; }
.header-nav a { color: #aaa; font-size: 13px; font-weight: 500; }
.header-nav a:hover { color: var(--text-white); text-decoration: none; }

/* ── Flash messages ─────────────────────────────────────────────── */
.flash-list { list-style: none; padding: 0; margin: 16px 0 0; }
.flash {
  padding: 12px 16px;
  border-radius: var(--radius);
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 500;
}
.flash.success { background: #e6f7f0; color: #1a6b45; border-left: 4px solid #2db37a; }
.flash.error   { background: #fdecea; color: #7a1a1a; border-left: 4px solid #e53935; }
.flash.info    { background: #e3f4f8; color: #1a5970; border-left: 4px solid var(--accent); }

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
  margin-bottom: 20px;
}
.card-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 17px;
  margin-bottom: 8px;
  color: var(--text);
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: 10px 24px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  font-size: 14px;
  cursor: pointer;
  border: none;
  transition: background 0.18s, transform 0.1s;
  text-decoration: none;
}
.btn:hover { transform: translateY(-1px); text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--text-white); }
.btn-primary:hover { background: var(--accent-hover); color: var(--text-white); }
.btn-outline { background: transparent; color: var(--accent); border: 2px solid var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--text-white); }
.btn-sm { padding: 6px 16px; font-size: 13px; }
.btn-danger { background: #e53935; color: #fff; }
.btn-danger:hover { background: #b71c1c; }

/* ── Status badges ──────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 3px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.badge-received      { background: #e8e8e8; color: #555; }
.badge-in_progress   { background: #e3f4f8; color: #1a5970; }
.badge-awaiting_parts{ background: #fff3e0; color: #7a4f00; }
.badge-quality_check { background: #ede7f6; color: #4527a0; }
.badge-complete      { background: #e6f7f0; color: #1a6b45; }
.badge-shipped       { background: #e8f5e9; color: #1b5e20; }

/* ── Workflow stepper ───────────────────────────────────────────── */
.stepper {
  position: relative;
  padding: 8px 0;
}
.stepper-item {
  display: flex;
  gap: 16px;
  margin-bottom: 0;
  position: relative;
}
.stepper-item:last-child .stepper-line { display: none; }
.stepper-item:not(:last-child) .stepper-line {
  position: absolute;
  left: 19px;
  top: 40px;
  width: 2px;
  bottom: 0;
  background: var(--border);
  min-height: 32px;
}
.stepper-item.complete .stepper-line { background: var(--accent); }
.stepper-item.in_progress .stepper-line { background: linear-gradient(to bottom, var(--accent), var(--border)); }

.stepper-dot {
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 14px;
  position: relative;
  z-index: 1;
  margin-top: 2px;
}
.stepper-item.complete .stepper-dot {
  background: var(--accent);
  color: #fff;
}
.stepper-item.in_progress .stepper-dot {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(46,143,168,0.2);
  animation: pulse 2s infinite;
}
.stepper-item.pending .stepper-dot {
  background: #e0e0e0;
  color: #999;
}
.stepper-item.current .stepper-dot {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 0 0 4px rgba(46,143,168,0.2);
}
.stepper-item.current:not(:last-child) .stepper-line {
  background: linear-gradient(to bottom, var(--accent), var(--border));
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 4px rgba(46,143,168,0.2); }
  50% { box-shadow: 0 0 0 8px rgba(46,143,168,0.1); }
}

.stepper-content {
  flex: 1;
  padding-bottom: 28px;
}
.stepper-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 15px;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.step-label-current {
  font-size: 11px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
  letter-spacing: 0.5px;
}
.stepper-desc {
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 12px;
  line-height: 1.5;
}

/* Step photos */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin-top: 10px;
}
.photo-thumb {
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 4/3;
  cursor: pointer;
}
.photo-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.2s;
}
.photo-thumb:hover img { transform: scale(1.04); }
.photo-caption { font-size: 11px; color: var(--text-light); margin-top: 4px; text-align: center; }

/* Lightbox */
.lightbox-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.88);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.lightbox-overlay.active { display: flex; }
.lightbox-overlay img {
  max-width: 100%;
  max-height: 90vh;
  border-radius: 8px;
  box-shadow: 0 8px 40px rgba(0,0,0,0.5);
}
.lightbox-close {
  position: absolute;
  top: 16px; right: 20px;
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  line-height: 1;
  opacity: 0.7;
}
.lightbox-close:hover { opacity: 1; }

/* ── Q&A ─────────────────────────────────────────────────────────── */
.qa-section { margin-top: 32px; }
.qa-section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 18px;
  margin-bottom: 16px;
  color: var(--text);
}
.question-block {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 12px;
}
.question-body {
  font-weight: 600;
  font-size: 14px;
  color: var(--text);
  margin-bottom: 4px;
}
.question-meta {
  font-size: 12px;
  color: var(--text-light);
  margin-bottom: 10px;
}
.reply-block {
  background: var(--bg);
  border-radius: 8px;
  padding: 12px 14px;
  margin-top: 8px;
  border-left: 3px solid var(--accent);
}
.reply-author {
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  margin-bottom: 4px;
}
.reply-body { font-size: 14px; color: var(--text); }

.qa-form { margin-top: 20px; }
.qa-form textarea {
  width: 100%;
  padding: 12px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  resize: vertical;
  min-height: 90px;
  transition: border-color 0.2s;
}
.qa-form textarea:focus { outline: none; border-color: var(--accent); }
.qa-form .btn { margin-top: 10px; }

/* ── FAQ ─────────────────────────────────────────────────────────── */
.faq-section { margin-top: 40px; padding-top: 32px; border-top: 2px solid var(--border); }
.faq-section-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 20px;
  margin-bottom: 20px;
  text-align: center;
}
.faq-item {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  margin-bottom: 8px;
  overflow: hidden;
}
.faq-question {
  padding: 14px 20px;
  font-weight: 700;
  font-size: 14px;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  user-select: none;
}
.faq-question::after { content: '+'; font-size: 20px; color: var(--accent); font-weight: 300; }
.faq-item.open .faq-question::after { content: '−'; }
.faq-answer {
  display: none;
  padding: 0 20px 14px;
  font-size: 14px;
  color: var(--text-light);
  line-height: 1.7;
}
.faq-item.open .faq-answer { display: block; }

/* ── Order list cards ───────────────────────────────────────────── */
.order-grid {
  display: grid;
  gap: 16px;
}
.order-card {
  background: var(--bg-white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 24px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  transition: box-shadow 0.2s, transform 0.15s;
  text-decoration: none;
  color: inherit;
}
.order-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  text-decoration: none;
  color: inherit;
}
.order-number { font-size: 12px; color: var(--text-light); font-weight: 600; letter-spacing: 0.5px; }
.order-title {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 16px;
}
.order-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.order-step-info { font-size: 13px; color: var(--text-light); }

/* ── Forms ──────────────────────────────────────────────────────── */
.form-group { margin-bottom: 18px; }
.form-label { display: block; font-weight: 600; font-size: 13px; margin-bottom: 6px; }
.form-control {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius);
  border: 1.5px solid var(--border);
  font-family: 'Inter', sans-serif;
  font-size: 14px;
  background: var(--bg-white);
  transition: border-color 0.2s;
}
.form-control:focus { outline: none; border-color: var(--accent); }

/* ── Login page ─────────────────────────────────────────────────── */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-dark);
  padding: 24px;
}
.login-card {
  background: var(--bg-white);
  border-radius: 16px;
  padding: 40px 36px;
  width: 100%;
  max-width: 400px;
  box-shadow: var(--shadow-md);
}
.login-brand {
  font-family: 'Bangers', cursive;
  font-size: 28px;
  letter-spacing: 2px;
  text-align: center;
  margin-bottom: 6px;
  color: var(--text);
}
.login-brand span { color: var(--accent); }
.login-subtitle {
  text-align: center;
  font-size: 13px;
  color: var(--text-light);
  margin-bottom: 28px;
}
.login-card h2 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 800;
  font-size: 18px;
  margin-bottom: 20px;
  text-align: center;
}

/* ── Page titles ────────────────────────────────────────────────── */
.page-title-bar {
  background: var(--bg-dark);
  padding: 20px 24px;
  margin-bottom: 24px;
}
.page-title-bar h1 {
  font-family: 'Montserrat', sans-serif;
  font-weight: 900;
  font-size: 20px;
  color: var(--text-white);
}
.page-title-bar p { color: #aaa; font-size: 13px; margin-top: 2px; }

/* ── Responsive ─────────────────────────────────────────────────── */
@media (max-width: 600px) {
  /* Header */
  .site-header { padding: 10px 14px; }
  .site-logo { height: 34px; }
  .header-nav { gap: 10px; }
  .header-nav span { display: none; }   /* hide username, keep logout */

  /* Page layout */
  .page-wrap { padding: 0 12px 32px; }
  .page-title-bar { padding: 14px 14px; }
  .page-title-bar h1 { font-size: 16px; }

  /* Cards */
  .card { padding: 16px; }

  /* Status banner — stack items vertically */
  .card > div[style*="display:flex"] { flex-direction: column; align-items: flex-start !important; }

  /* Stepper */
  .stepper-item { gap: 10px; }
  .stepper-dot { width: 34px; height: 34px; font-size: 12px; }
  .stepper-item:not(:last-child) .stepper-line { left: 16px; top: 36px; }
  .stepper-item.current:not(:last-child) .stepper-line { left: 16px; }
  .stepper-title { font-size: 14px; flex-wrap: wrap; }
  .stepper-content { padding-bottom: 20px; }

  /* Login */
  .login-card { padding: 28px 18px; }

  /* Photos */
  .photo-grid { grid-template-columns: repeat(2, 1fr); }

  /* Q&A form button full width */
  .qa-form .btn { display: block; width: 100%; text-align: center; }

  /* Order cards */
  .order-card { padding: 16px; }
}
