/* ═══════════════════════════════════════════
   SetupClaw – Pages Shared CSS
   (order.html, payment.html)
   ═══════════════════════════════════════════ */

/* ── Task Chips ── */
.tasks-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

.task-chip {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
}

.task-chip input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.task-chip span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border: 1.5px solid var(--border);
  border-radius: 100px;
  font-size: 0.84rem;
  font-weight: 500;
  color: var(--text-muted);
  background: var(--bg);
  transition: all var(--transition);
  white-space: nowrap;
}

.task-chip:hover span {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(229, 62, 62, 0.05);
}

.task-chip input:checked + span {
  border-color: var(--accent);
  background: rgba(229, 62, 62, 0.12);
  color: var(--accent);
  font-weight: 600;
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.08);
}

.task-custom-wrap {
  margin-top: 10px;
}

/* ── Page Layout ── */
.page-main {
  padding: calc(var(--nav-h) + 40px) 0 80px;
  min-height: 100vh;
}

/* ── Progress Steps ── */
.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  margin-bottom: 48px;
}

.progress-step {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  position: relative;
}

.ps-circle {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 0.9rem;
  background: var(--bg-surface);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: all 0.3s;
}

.progress-step.active .ps-circle {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 0 20px var(--accent-glow);
}

.progress-step.done .ps-circle {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}

.progress-step span {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--text-muted);
  white-space: nowrap;
}

.progress-step.active span { color: var(--accent); font-weight: 600; }
.progress-step.done span { color: var(--success); }

.progress-line {
  flex: 1;
  height: 2px;
  background: var(--border);
  margin: 0 12px;
  margin-bottom: 28px;
  min-width: 60px;
  max-width: 120px;
  transition: background 0.3s;
}

.progress-line.active-line { background: var(--accent); }

/* ═══════════════════
   ORDER PAGE
   ═══════════════════ */
.order-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 32px;
  align-items: start;
}

/* Form card */
.form-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 40px;
}

.form-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 36px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border);
}

.form-icon {
  font-size: 2.2rem;
  flex-shrink: 0;
}

.form-header h2 { font-size: 1.4rem; margin-bottom: 6px; }
.form-header p { color: var(--text-muted); font-size: 0.9rem; }

/* Form Groups */
.form-group {
  margin-bottom: 24px;
}

.form-label {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 8px;
  color: var(--text);
}

.label-required { color: var(--accent); font-size: 1rem; }
.label-optional { color: var(--text-subtle); font-weight: 400; font-size: 0.8rem; }

.form-input {
  width: 100%;
  padding: 13px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 0.95rem;
  font-family: var(--font);
  transition: all var(--transition);
  outline: none;
}

.form-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(229, 62, 62, 0.12);
}

.form-input.error {
  border-color: var(--error);
  box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.12);
}

.form-input.success {
  border-color: var(--success);
}

.form-textarea {
  resize: vertical;
  min-height: 90px;
}

.form-hint {
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-top: 6px;
}

.char-count { text-align: right; }

.form-error {
  font-size: 0.8rem;
  color: var(--error);
  margin-top: 5px;
  display: none;
  align-items: center;
  gap: 4px;
}
.form-error.visible { display: flex; }

/* Input with toggle button */
.input-with-toggle {
  position: relative;
}

.input-with-toggle .form-input {
  padding-right: 48px;
}

.toggle-visibility {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1.1rem;
  background: none;
  border: none;
  cursor: pointer;
  opacity: 0.6;
  transition: opacity 0.2s;
}
.toggle-visibility:hover { opacity: 1; }

/* Phone input */
.phone-input-wrap {
  display: flex;
  align-items: center;
  gap: 0;
}

.phone-prefix {
  padding: 13px 14px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border);
  border-right: none;
  border-radius: var(--radius) 0 0 var(--radius);
  font-size: 0.88rem;
  color: var(--text-muted);
  white-space: nowrap;
  font-weight: 500;
}

.phone-input {
  border-radius: 0 var(--radius) var(--radius) 0;
}

/* Checkbox */
.checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.checkbox-label input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.checkbox-custom {
  width: 18px;
  height: 18px;
  min-width: 18px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  background: var(--bg);
  transition: all 0.2s;
  position: relative;
  margin-top: 1px;
}

.checkbox-label input:checked + .checkbox-custom {
  background: var(--accent);
  border-color: var(--accent);
}

.checkbox-label input:checked + .checkbox-custom::after {
  content: '✓';
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 700;
}

.link-accent { color: var(--accent); text-decoration: underline; }

/* BotFather Guide */
.botfather-guide {
  margin-top: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}

.guide-toggle {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  border: none;
  text-align: left;
  transition: all 0.2s;
}
.guide-toggle:hover { color: var(--accent); background: rgba(229,62,62,0.06); }

.guide-chevron {
  margin-left: auto;
  font-size: 0.7rem;
  transition: transform 0.3s;
}
.guide-chevron.open { transform: rotate(180deg); }

.guide-content {
  display: none;
  padding: 20px;
  border-top: 1px solid var(--border);
  background: var(--bg);
}
.guide-content.open { display: block; }

.guide-steps { display: flex; flex-direction: column; gap: 14px; margin-bottom: 16px; }

.guide-step {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.guide-num {
  width: 24px;
  height: 24px;
  min-width: 24px;
  background: var(--accent);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.75rem;
  font-weight: 700;
  margin-top: 1px;
}

.guide-text {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.guide-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--accent);
  font-size: 0.82rem;
  margin-left: 8px;
}
.guide-link:hover { text-decoration: underline; }

.inline-code {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 0.82rem;
  color: var(--accent);
}

.guide-note {
  background: rgba(229, 62, 62, 0.06);
  border: 1px solid rgba(229, 62, 62, 0.2);
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
}

/* Submit Button */
.submit-btn {
  width: 100%;
  padding: 16px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: var(--shadow-accent);
  margin-top: 8px;
}
.submit-btn:hover:not(:disabled) {
  background: var(--accent-hover);
  transform: translateY(-2px);
  box-shadow: 0 12px 40px var(--accent-glow);
}
.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.spinner {
  display: inline-block;
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255,255,255,0.3);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  vertical-align: middle;
}

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

/* ── Order Summary (shared) ── */
.order-summary-wrap, .payment-sidebar { display: flex; flex-direction: column; gap: 16px; }

.summary-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 28px;
}

.sticky-card { position: sticky; top: calc(var(--nav-h) + 20px); }

.summary-title {
  font-size: 0.85rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin-bottom: 20px;
}

.summary-plan {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 20px;
}

.summary-plan-icon { font-size: 2rem; }
.summary-plan-name { font-size: 1.1rem; font-weight: 700; }
.summary-plan-duration { font-size: 0.8rem; color: var(--text-muted); margin-top: 2px; }

.summary-features { margin-bottom: 16px; }
.summary-features ul { display: flex; flex-direction: column; gap: 8px; }
.summary-features li {
  font-size: 0.83rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
}
.summary-features .check { color: var(--success); font-size: 0.85rem; }

.summary-divider {
  height: 1px;
  background: var(--border);
  margin: 16px 0;
}

.summary-price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  margin-bottom: 8px;
  color: var(--text-muted);
}
.summary-price-row.total {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.price-free { color: var(--success); font-weight: 600; }
.total-price { color: var(--accent); font-size: 1.2rem; font-weight: 800; }

.summary-badge {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(229, 62, 62, 0.06);
  border: 1px solid rgba(229, 62, 62, 0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 16px;
}

.summary-guarantee {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  background: rgba(34, 197, 94, 0.06);
  border: 1px solid rgba(34, 197, 94, 0.15);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 8px;
}

/* Support box */
.support-box {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 20px;
}

.support-title {
  font-size: 0.85rem;
  font-weight: 600;
  margin-bottom: 12px;
}

.support-links { display: flex; gap: 10px; }

.support-link {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  border-radius: 8px;
  font-size: 0.82rem;
  font-weight: 600;
  transition: all 0.2s;
  border: 1px solid var(--border);
}
.support-link.telegram {
  background: rgba(41, 182, 246, 0.08);
  color: #29b6f6;
  border-color: rgba(41, 182, 246, 0.2);
}
.support-link.telegram:hover { background: rgba(41, 182, 246, 0.15); }
.support-link.zalo {
  background: rgba(0, 113, 255, 0.08);
  color: #0071ff;
  border-color: rgba(0, 113, 255, 0.2);
}
.support-link.zalo:hover { background: rgba(0, 113, 255, 0.15); }

/* ═══════════════════
   PAYMENT PAGE
   ═══════════════════ */
.payment-layout {
  display: grid;
  grid-template-columns: 1fr 360px;
  gap: 32px;
  align-items: start;
}

.payment-main { display: flex; flex-direction: column; gap: 20px; }

.payment-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: 36px;
}

.payment-header {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}
.payment-icon { font-size: 2.2rem; flex-shrink: 0; }
.payment-header h2 { font-size: 1.4rem; margin-bottom: 6px; }
.payment-header p { color: var(--text-muted); font-size: 0.9rem; }

/* QR Section */
.qr-section {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 32px;
  align-items: start;
}

.qr-wrapper {
  position: relative;
  width: 220px;
  min-height: 220px;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  flex-shrink: 0;
}

.qr-badge {
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  padding: 3px 12px;
  background: var(--accent);
  color: #fff;
  border-radius: 100px;
  font-size: 0.7rem;
  font-weight: 700;
  white-space: nowrap;
}

.qr-image {
  width: 196px;
  height: 196px;
  object-fit: contain;
  border-radius: 8px;
  display: none;
}
.qr-image.loaded { display: block; }

.qr-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

.qr-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

/* Bank info */
.bank-info-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 16px;
}

.bank-logo { font-size: 1.8rem; }
.bank-details { flex: 1; }
.bank-name { font-weight: 700; font-size: 0.95rem; margin-bottom: 3px; }
.bank-account, .bank-owner { font-size: 0.83rem; color: var(--text-muted); }

.copy-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  cursor: pointer;
  font-size: 1rem;
  transition: all 0.2s;
  flex-shrink: 0;
}
.copy-btn:hover { border-color: var(--accent); }

.transfer-details {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-bottom: 16px;
}

.transfer-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.tr-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 500;
  min-width: 90px;
}

.tr-value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--text);
}

.tr-content-wrap { display: flex; align-items: center; gap: 8px; }

.amount-val { color: var(--accent); font-size: 1.1rem; font-weight: 800; }
.content-val {
  font-family: var(--font-mono);
  background: var(--bg-surface);
  padding: 4px 10px;
  border-radius: 6px;
  border: 1px solid var(--border);
  font-size: 0.88rem;
  color: var(--info);
}

.copy-small {
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}
.copy-small:hover { border-color: var(--accent); }

.payment-note {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  border-radius: 8px;
  padding: 12px 14px;
  font-size: 0.82rem;
  color: var(--text-muted);
  line-height: 1.55;
}

/* Status card */
.status-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
}

.status-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
  font-weight: 600;
}

.status-pulse {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--warning);
  box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4);
  animation: statusPulse 2s infinite;
  flex-shrink: 0;
}

.status-pulse.success { background: var(--success); animation: statusPulseGreen 2s infinite; }

@keyframes statusPulse {
  0% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(245, 158, 11, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 158, 11, 0); }
}
@keyframes statusPulseGreen {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.4); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

.status-progress-bar {
  height: 6px;
  background: var(--bg-surface);
  border-radius: 100px;
  overflow: hidden;
  margin-bottom: 10px;
}

.status-progress-fill {
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--accent), var(--success));
  border-radius: 100px;
  transition: width 0.5s ease;
}

.status-sub { font-size: 0.82rem; color: var(--text-muted); }

.manual-confirm { margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); }
.manual-confirm p { font-size: 0.85rem; color: var(--text-muted); }

/* Timer */
.timer-card {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 0.88rem;
  color: var(--text-muted);
}

.timer-countdown {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--accent);
  font-size: 1rem;
  margin-left: auto;
}

/* Order meta */
.order-meta { display: flex; flex-direction: column; gap: 8px; }
.meta-row {
  display: flex;
  justify-content: space-between;
  font-size: 0.83rem;
  gap: 12px;
}
.meta-label { color: var(--text-muted); }
.meta-value {
  color: var(--text);
  font-weight: 500;
  text-align: right;
  word-break: break-all;
}

/* Coffee card in pricing */
.pricing-card.coffee-card {
  background: linear-gradient(160deg, rgba(180, 83, 9, 0.08) 0%, var(--bg) 60%);
  border-color: rgba(180, 83, 9, 0.3);
}

.coffee-badge {
  position: absolute;
  top: -14px;
  left: 50%;
  transform: translateX(-50%);
  padding: 6px 18px;
  background: linear-gradient(135deg, #92400e, #d97706);
  color: #fff;
  border-radius: 100px;
  font-size: 0.78rem;
  font-weight: 700;
  white-space: nowrap;
}

.plan-btn.btn-coffee {
  background: linear-gradient(135deg, #92400e, #d97706);
  color: #fff;
}
.plan-btn.btn-coffee:hover { filter: brightness(1.1); }

/* ── Form Alert ── */
.form-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.88rem;
  line-height: 1.55;
  margin-bottom: 16px;
  animation: fadeInUp 0.3s ease;
}

.form-alert-error {
  background: rgba(239, 68, 68, 0.08);
  border: 1px solid rgba(239, 68, 68, 0.25);
  color: var(--text);
}

.form-alert-warning {
  background: rgba(245, 158, 11, 0.08);
  border: 1px solid rgba(245, 158, 11, 0.25);
  color: var(--text);
}

.form-alert-success {
  background: rgba(34, 197, 94, 0.08);
  border: 1px solid rgba(34, 197, 94, 0.25);
  color: var(--text);
}

.form-alert-icon { font-size: 1.1rem; flex-shrink: 0; margin-top: 1px; }
.form-alert-text { flex: 1; color: var(--text-muted); }

.form-alert-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  color: var(--text-muted);
  padding: 0 4px;
  line-height: 1;
  opacity: 0.6;
  transition: opacity 0.2s;
  flex-shrink: 0;
}
.form-alert-close:hover { opacity: 1; }

/* ── Bot Username Link (activating success) ── */
.bot-username-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--info);
  margin-top: 4px;
  transition: color 0.2s;
}
.bot-username-link:hover { color: var(--accent); text-decoration: underline; }
.bot-username-link:empty { display: none; }

/* ── Responsive ── */
@media (max-width: 900px) {
  .order-layout, .payment-layout {
    grid-template-columns: 1fr;
  }
  .sticky-card { position: static; }
  .order-summary-wrap, .payment-sidebar { order: -1; }
  .qr-section { grid-template-columns: 1fr; }
  .qr-wrapper { width: 100%; max-width: 240px; margin: 0 auto; }
  .form-card { padding: 24px; }
  .payment-card { padding: 24px; }
}

@media (max-width: 600px) {
  .progress-steps { gap: 0; }
  .progress-line { min-width: 30px; }
  .progress-step span { font-size: 0.7rem; }
  .ps-circle { width: 32px; height: 32px; font-size: 0.8rem; }
}
