/* ================================================================
   TCDSS Custom Orders — main.css
   ================================================================ */

:root {
  --brand:        #7F77DD;
  --brand-dark:   #534AB7;
  --brand-light:  #EEEDFE;
  --accent:       #1D9E75;
  --accent-dark:  #0F6E56;
  --text:         #1a1a2e;
  --text-muted:   #6b7280;
  --border:       #e5e7eb;
  --bg:           #f9fafb;
  --bg-card:      #ffffff;
  --radius:       12px;
  --radius-sm:    8px;
  --shadow:       0 1px 3px rgba(0,0,0,.08), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:    0 4px 6px rgba(0,0,0,.07), 0 2px 4px rgba(0,0,0,.04);
}

/* ── Reset & base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  margin: 0;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); }
a:hover { color: var(--brand-dark); }
img { max-width: 100%; height: auto; }

/* ── Site notices ───────────────────────────────────────────────── */
.site-notices { position: sticky; top: 0; z-index: 100; }
.site-notices .alert {
  border-radius: 0;
  border: none;
  border-bottom: 1px solid rgba(0,0,0,.08);
  margin: 0;
  font-size: 14px;
  padding: 10px 16px;
}

/* ── Header ─────────────────────────────────────────────────────── */
.site-header {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.site-logo {
  font-size: 18px;
  font-weight: 700;
  color: var(--brand);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo img { height: 36px; width: auto; }
.header-nav { display: flex; align-items: center; gap: 12px; }
.header-nav a {
  font-size: 14px;
  color: var(--text-muted);
  text-decoration: none;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
}
.header-nav a:hover { background: var(--brand-light); color: var(--brand); }

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

/* ── Cards ──────────────────────────────────────────────────────── */
.card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
}
.card + .card { margin-top: 16px; }
.card-title {
  font-size: 18px;
  font-weight: 600;
  margin: 0 0 4px;
  color: var(--text);
}
.card-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin: 0 0 20px;
}

/* ── Form elements ──────────────────────────────────────────────── */
.field { margin-bottom: 16px; }
.field label {
  display: block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  margin-bottom: 6px;
}
.field label .req { color: #e74c3c; margin-left: 2px; }
.field input[type=text],
.field input[type=email],
.field input[type=tel],
.field input[type=date],
.field input[type=number],
.field input[type=password],
.field select,
.field textarea {
  width: 100%;
  padding: 10px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  appearance: none;
  -webkit-appearance: none;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(127,119,221,.15);
}
.field textarea { resize: vertical; min-height: 90px; }
.field .hint {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 4px;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
@media (max-width: 480px) { .field-row { grid-template-columns: 1fr; } }

/* ── Chips ──────────────────────────────────────────────────────── */
.chip-group { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.chip {
  padding: 7px 16px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  background: #fff;
  color: var(--text-muted);
  transition: all .15s;
  user-select: none;
  white-space: nowrap;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.selected {
  background: var(--brand-light);
  border-color: var(--brand);
  color: var(--brand-dark);
  font-weight: 500;
}

/* ── Progress bar ───────────────────────────────────────────────── */
.progress-wrap { margin-bottom: 24px; }
.progress-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin-bottom: 8px;
}
.step-dot {
  width: 30px; height: 30px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
  flex-shrink: 0;
  transition: all .2s;
}
.step-dot.done     { background: var(--accent); color: #fff; }
.step-dot.active   { background: var(--brand);  color: #fff; }
.step-dot.upcoming { background: #fff; color: var(--text-muted); border: 1.5px solid var(--border); }
.step-line { flex: 1; height: 2px; background: var(--border); }
.step-line.done { background: var(--accent); }
.step-label-row {
  display: flex;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding: 0 4px;
}

/* ── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 11px 22px;
  border-radius: var(--radius-sm);
  font-size: 15px;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.btn-primary   { background: var(--brand);  color: #fff; }
.btn-primary:hover  { background: var(--brand-dark); color: #fff; }
.btn-success   { background: var(--accent); color: #fff; }
.btn-success:hover  { background: var(--accent-dark); color: #fff; }
.btn-outline   { background: #fff; color: var(--text-muted); border: 1.5px solid var(--border); }
.btn-outline:hover  { border-color: var(--brand); color: var(--brand); }
.btn-ghost     { background: none; color: var(--text-muted); }
.btn-ghost:hover    { color: var(--brand); }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.btn-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 24px;
  gap: 12px;
}

/* ── Upload area ────────────────────────────────────────────────── */
.upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 24px 16px;
  text-align: center;
  cursor: pointer;
  position: relative;
  transition: all .15s;
  background: #fff;
}
.upload-area:hover, .upload-area.drag-over {
  border-color: var(--brand);
  background: var(--brand-light);
}
.upload-area input[type=file] {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer;
  width: 100%; height: 100%;
}
.upload-icon { font-size: 32px; color: var(--text-muted); margin-bottom: 8px; }
.upload-label { font-size: 14px; color: var(--text-muted); }
.upload-sub { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.upload-previews {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px;
}
.upload-thumb {
  width: 72px; height: 72px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  border: 1px solid var(--border);
  position: relative;
}
.upload-thumb-wrap { position: relative; }
.upload-thumb-remove {
  position: absolute; top: -6px; right: -6px;
  width: 20px; height: 20px;
  background: #e74c3c; color: #fff;
  border-radius: 50%; border: none;
  font-size: 12px; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
}
.upload-progress {
  height: 3px; background: var(--brand-light);
  border-radius: 2px; margin-top: 8px; overflow: hidden;
}
.upload-progress-bar {
  height: 100%; background: var(--brand);
  transition: width .3s;
  border-radius: 2px;
}

/* ── Colour picker ──────────────────────────────────────────────── */
.colour-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.colour-swatch {
  width: 36px; height: 36px;
  border-radius: 50%; border: 2px solid var(--border);
  flex-shrink: 0; cursor: pointer; overflow: hidden;
}
.colour-swatch input[type=color] {
  width: 100%; height: 100%;
  border: none; padding: 0; cursor: pointer;
  opacity: 0; position: absolute;
}
.colour-swatch-wrap { position: relative; width: 36px; height: 36px; }

/* ── Notice / info box ──────────────────────────────────────────── */
.info-box {
  background: var(--brand-light);
  border-left: 3px solid var(--brand);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 12px 16px;
  font-size: 13px;
  color: var(--text-muted);
  display: flex; gap: 10px; align-items: flex-start;
  margin-top: 12px;
}
.info-box i { flex-shrink: 0; margin-top: 1px; }

/* ── Badges ─────────────────────────────────────────────────────── */
.badge {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 10px; border-radius: 20px;
  font-size: 12px; font-weight: 500;
}
.badge-secondary { background: #f3f4f6; color: var(--text-muted); }
.badge-info      { background: #dbeafe; color: #1e40af; }
.badge-primary   { background: var(--brand-light); color: var(--brand-dark); }
.badge-success   { background: #d1fae5; color: #065f46; }
.badge-warning   { background: #fef3c7; color: #92400e; }
.badge-danger    { background: #fee2e2; color: #991b1b; }

/* ── Summary table ──────────────────────────────────────────────── */
.summary-table { width: 100%; border-collapse: collapse; }
.summary-table td { padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.summary-table tr:last-child td { border-bottom: none; }
.summary-table td:first-child { color: var(--text-muted); width: 40%; }
.summary-table td:last-child { font-weight: 500; text-align: right; }
.summary-total td { font-weight: 700; font-size: 16px; padding-top: 12px; }

/* ── Order status page ──────────────────────────────────────────── */
.order-header {
  display: flex; align-items: flex-start;
  justify-content: space-between; gap: 12px;
  flex-wrap: wrap; margin-bottom: 20px;
}
.order-ref { font-size: 13px; color: var(--text-muted); margin-bottom: 4px; }
.order-title { font-size: 22px; font-weight: 700; margin: 0; }
.job-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
}
.job-card-header {
  display: flex; justify-content: space-between;
  align-items: center; margin-bottom: 12px;
  flex-wrap: wrap; gap: 8px;
}
.job-card-title { font-weight: 600; font-size: 15px; }
.design-preview {
  width: 100%;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  max-height: 300px;
  object-fit: contain;
  background: #f9fafb;
}

/* ── Message thread ─────────────────────────────────────────────── */
.message-thread { display: flex; flex-direction: column; gap: 12px; }
.message-bubble {
  max-width: 82%;
  padding: 10px 14px;
  border-radius: 12px;
  font-size: 14px;
  line-height: 1.5;
}
.message-bubble.admin {
  background: var(--brand-light);
  color: var(--brand-dark);
  align-self: flex-start;
  border-bottom-left-radius: 3px;
}
.message-bubble.customer {
  background: #f3f4f6;
  color: var(--text);
  align-self: flex-end;
  border-bottom-right-radius: 3px;
}
.message-meta {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 3px;
}
.message-meta.admin { text-align: left; }
.message-meta.customer { text-align: right; }

/* ── Bulk order table ───────────────────────────────────────────── */
.bulk-item-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin-bottom: 12px;
  background: #fff;
  position: relative;
}
.bulk-item-number {
  font-size: 12px; font-weight: 600;
  color: var(--brand); margin-bottom: 12px;
  text-transform: uppercase; letter-spacing: .05em;
}
.bulk-item-remove {
  position: absolute; top: 12px; right: 12px;
  background: none; border: none;
  color: var(--text-muted); cursor: pointer;
  font-size: 18px; line-height: 1;
  padding: 4px;
}
.bulk-item-remove:hover { color: #e74c3c; }

/* ── Success / confirmation ─────────────────────────────────────── */
.success-wrap { text-align: center; padding: 32px 16px; }
.success-icon { font-size: 56px; color: var(--accent); margin-bottom: 16px; }
.success-title { font-size: 22px; font-weight: 700; margin: 0 0 8px; }
.success-sub { color: var(--text-muted); font-size: 15px; margin: 0 0 24px; }

/* ── Alert ──────────────────────────────────────────────────────── */
.alert {
  padding: 12px 16px; border-radius: var(--radius-sm);
  font-size: 14px; margin-bottom: 16px;
  display: flex; align-items: flex-start; gap: 8px;
}
.alert-success { background: #d1fae5; color: #065f46; border: 1px solid #6ee7b7; }
.alert-danger  { background: #fee2e2; color: #991b1b; border: 1px solid #fca5a5; }
.alert-warning { background: #fef3c7; color: #92400e; border: 1px solid #fcd34d; }
.alert-info    { background: #dbeafe; color: #1e40af; border: 1px solid #93c5fd; }

/* ── T&Cs checkbox ──────────────────────────────────────────────── */
.terms-check {
  display: flex; align-items: flex-start; gap: 10px;
  background: #fffbeb;
  border: 1.5px solid #fcd34d;
  border-radius: var(--radius-sm);
  padding: 14px 16px;
  margin-bottom: 16px;
}
.terms-check input[type=checkbox] {
  width: 18px; height: 18px;
  flex-shrink: 0; margin-top: 2px;
  accent-color: var(--brand);
  cursor: pointer;
}
.terms-check label {
  font-size: 13px; color: var(--text);
  cursor: pointer; line-height: 1.5;
}

/* ── Spinner ────────────────────────────────────────────────────── */
.spinner {
  width: 20px; height: 20px;
  border: 2px solid rgba(255,255,255,.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin .6s linear infinite;
  display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Footer ─────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 24px 16px;
  font-size: 13px;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 48px;
}
.site-footer a { color: var(--text-muted); }
