:root {
  --bg: #f4f6fb;
  --surface: #ffffff;
  --surface-alt: #f8fafc;
  --ink: #0f172a;
  --muted: #64748b;
  --border: #e2e8f0;
  --brand: #4f46e5;
  --brand-dark: #4338ca;
  --brand-soft: #eef2ff;
  --emerald: #10b981;
  --emerald-dark: #059669;
  --emerald-soft: #ecfdf5;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --amber-soft: #fffbeb;
  --danger: #ef4444;
  --radius-lg: 22px;
  --radius-md: 14px;
  --shadow-sm: 0 4px 18px rgba(15, 23, 42, 0.05);
  --shadow-lg: 0 14px 35px rgba(79, 70, 229, 0.16);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.5;
  min-height: 100vh;
  padding-bottom: 48px;
}

.hidden {
  display: none !important;
}

/* Header */
.app-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 12px 16px;
}

.header-inner {
  max-width: 500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.brand-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.brand-logo {
  width: 40px;
  height: 40px;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--brand), #7c3aed);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 900;
  font-size: 18px;
  flex-shrink: 0;
  box-shadow: 0 6px 14px rgba(79, 70, 229, 0.28);
}

.shop-title {
  font-size: 15px;
  font-weight: 800;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.shop-subtitle {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cloud-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--emerald-soft);
  color: #065f46;
  border: 1px solid #a7f3d0;
  flex-shrink: 0;
}

.cloud-pill.offline {
  background: var(--amber-soft);
  color: #92400e;
  border-color: #fde68a;
}

.pulse-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--emerald);
  animation: pulse 1.6s infinite;
}

.cloud-pill.offline .pulse-dot {
  background: var(--amber);
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.25); opacity: 0.55; }
}

/* Main Container */
.container {
  max-width: 500px;
  margin: 18px auto 0;
  padding: 0 14px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-sm);
}

/* Alert Banner */
.setup-banner {
  background: #fff7ed;
  border: 1px solid #fed7aa;
  border-radius: var(--radius-md);
  padding: 14px;
  font-size: 12px;
  color: #9a3412;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setup-banner strong {
  font-size: 13px;
  color: #7c2d12;
}

/* Step Badges */
.step-heading {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 15px;
  font-weight: 800;
  margin-bottom: 14px;
}

.step-num {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

/* Dropzone */
.dropzone {
  border: 2px dashed #c7d2fe;
  background: #f8faff;
  border-radius: 18px;
  padding: 28px 16px;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.dropzone:hover, .dropzone.dragover {
  border-color: var(--brand);
  background: var(--brand-soft);
}

.dropzone-icon {
  width: 54px;
  height: 54px;
  margin: 0 auto 10px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 12px rgba(79, 70, 229, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
}

.dropzone-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--ink);
}

.dropzone-sub {
  font-size: 12px;
  color: var(--muted);
  margin-top: 3px;
}

.file-types {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 12px;
}

.file-types span {
  font-size: 10px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  border: 1px solid var(--border);
}

/* Selected File Card */
.file-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  background: var(--surface-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 12px;
  margin-top: 12px;
}

.file-chip-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.file-badge-icon {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand-soft);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
}

.file-name {
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.file-meta {
  font-size: 11px;
  color: var(--brand);
  font-weight: 700;
}

.btn-remove {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: #e2e8f0;
  color: #475569;
  font-weight: 700;
  cursor: pointer;
  flex-shrink: 0;
}

.btn-remove:hover {
  background: #fee2e2;
  color: var(--danger);
}

/* Form Controls */
.field-group {
  margin-bottom: 14px;
}

.field-label {
  display: block;
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-bottom: 6px;
}

.grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.choice-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid var(--border);
  background: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  font-weight: 600;
  color: #334155;
  transition: all 0.15s ease;
}

.choice-btn.active {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--ink);
  font-weight: 800;
}

.price-tag {
  font-size: 11px;
  color: var(--brand);
  font-weight: 800;
}

.segmented {
  display: flex;
  background: #f1f5f9;
  padding: 4px;
  border-radius: var(--radius-md);
  gap: 4px;
}

.seg-btn {
  flex: 1;
  border: none;
  background: transparent;
  padding: 9px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  cursor: pointer;
}

.seg-btn.active {
  background: #fff;
  color: var(--ink);
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(15, 23, 42, 0.07);
}

.stepper {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border-radius: var(--radius-md);
  padding: 3px;
}

.step-btn {
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 10px;
  background: #fff;
  font-size: 18px;
  font-weight: 800;
  cursor: pointer;
  color: var(--ink);
  box-shadow: 0 1px 3px rgba(0,0,0,0.08);
}

.step-val {
  flex: 1;
  text-align: center;
  font-size: 14px;
  font-weight: 800;
}

.input-text {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  font-size: 13px;
  font-family: inherit;
  outline: none;
  background: #fff;
}

.input-text:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

/* Dark Summary & Checkout Card */
.checkout-card {
  background: linear-gradient(160deg, #0f172a, #1e293b);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 20px;
  box-shadow: var(--shadow-lg);
}

.summary-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 14px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
  margin-bottom: 14px;
}

.summary-label {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: #94a3b8;
  font-weight: 700;
}

.summary-price {
  font-size: 30px;
  font-weight: 900;
  letter-spacing: -0.02em;
  margin-top: 2px;
}

.summary-meta {
  text-align: right;
  font-size: 12px;
  color: #cbd5e1;
}

.summary-mode {
  font-size: 11px;
  color: #34d399;
  font-weight: 700;
  margin-top: 2px;
}

.pay-method-btn {
  padding: 12px;
  border-radius: var(--radius-md);
  border: 1.5px solid #334155;
  background: rgba(255,255,255,0.05);
  color: #fff;
  text-align: left;
  cursor: pointer;
  transition: all 0.15s ease;
}

.pay-method-btn.active-cash {
  border-color: var(--amber);
  background: rgba(245, 158, 11, 0.15);
}

.pay-method-btn.active-online {
  border-color: var(--emerald);
  background: rgba(16, 185, 129, 0.15);
}

.pay-tag {
  font-size: 9px;
  font-weight: 900;
  padding: 2px 6px;
  border-radius: 5px;
  text-transform: uppercase;
}

.tag-cash { background: var(--amber); color: #451a03; }
.tag-online { background: var(--emerald); color: #022c22; }

.pay-method-title {
  font-size: 13px;
  font-weight: 800;
  margin-top: 6px;
}

.pay-method-sub {
  font-size: 11px;
  color: #94a3b8;
}

.btn-primary-submit {
  width: 100%;
  margin-top: 14px;
  padding: 15px;
  border: none;
  border-radius: 16px;
  font-size: 14px;
  font-weight: 900;
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform 0.1s ease, opacity 0.2s;
}

.btn-primary-submit:active {
  transform: scale(0.98);
}

.btn-primary-submit:disabled {
  opacity: 0.7;
  cursor: not-allowed;
}

.btn-cash-grad {
  background: linear-gradient(135deg, var(--amber), var(--amber-dark));
  box-shadow: 0 8px 20px rgba(245, 158, 11, 0.35);
}

.btn-online-grad {
  background: linear-gradient(135deg, var(--emerald), #0d9488);
  box-shadow: 0 8px 20px rgba(16, 185, 129, 0.35);
}

/* Upload Progress Bar */
.upload-progress-wrap {
  margin-top: 12px;
  background: rgba(255,255,255,0.1);
  border-radius: 999px;
  height: 8px;
  overflow: hidden;
}

.upload-progress-bar {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, #34d399, #60a5fa);
  transition: width 0.2s ease;
}

/* Tracking & Payment Cards */
.token-ticket {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: 24px 20px;
  text-align: center;
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.25);
}

.token-pill {
  display: inline-block;
  padding: 4px 12px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.2);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.token-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 38px;
  font-weight: 900;
  margin: 8px 0 6px;
}

.btn-razorpay {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #4f46e5);
  color: #fff;
  font-size: 14px;
  font-weight: 900;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.3);
}

.btn-secondary {
  width: 100%;
  padding: 11px;
  border-radius: 14px;
  border: 1px solid var(--border);
  background: var(--surface-alt);
  color: var(--ink);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.timeline {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-top: 14px;
}

.tl-item {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tl-dot {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
  flex-shrink: 0;
  background: #e2e8f0;
  color: #64748b;
}

.tl-dot.done {
  background: var(--emerald);
  color: #fff;
}

.tl-dot.active {
  background: var(--brand);
  color: #fff;
  animation: pulse 1.4s infinite;
}

.tl-dot.waiting {
  background: var(--amber);
  color: #fff;
  animation: pulse 1.4s infinite;
}

.tl-title {
  font-size: 13px;
  font-weight: 700;
}

.tl-desc {
  font-size: 11px;
  color: var(--muted);
}

.status-badge {
  font-size: 11px;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--amber-soft);
  color: #92400e;
}

.status-badge.paid {
  background: #e0f2fe;
  color: #075985;
}

.status-badge.printing {
  background: var(--brand-soft);
  color: var(--brand-dark);
}

.status-badge.done {
  background: var(--emerald-soft);
  color: #065f46;
}
