/* ── Order Page Specific Styles ── */

/* Page hero */
.page-hero {
  padding: 64px 0 48px;
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.page-hero .section-title { margin-bottom: 12px; }
.page-hero .section-body   { font-size: 1rem; }

/* ── Layout ── */
main { padding: 56px 0 96px; }

.form-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 48px;
  align-items: start;
}

/* ── Form sections ── */
.order-form {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.form-section {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 36px 32px;
  background: var(--surface);
  margin-bottom: 24px;
}

.optional-section {
  border-color: rgba(201,151,58,0.2);
  background: rgba(201,151,58,0.025);
}

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

.form-section-num {
  font-size: 2rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
  flex-shrink: 0;
  letter-spacing: -0.04em;
}

.optional-num { color: var(--accent-dim); opacity: 0.6; }

.form-section-title {
  font-size: 1.15rem;
  font-weight: 700;
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.form-section-desc {
  color: var(--text-muted);
  font-size: 0.88rem;
}

.optional-badge {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--accent-dim);
  border: 1px solid var(--accent-dim);
  border-radius: 50px;
  padding: 2px 10px;
  vertical-align: middle;
}

/* ── Fields ── */
.field-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 7px;
  margin-bottom: 20px;
}

.field:last-child { margin-bottom: 0; }

.field label {
  font-size: 0.88rem;
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.01em;
}

.required { color: var(--accent); }

.optional {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 0.82rem;
}

.field input[type="text"],
.field input[type="email"],
.field input[type="url"],
.field textarea {
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  padding: 11px 14px;
  font-size: 0.95rem;
  font-family: inherit;
  transition: border-color .2s, box-shadow .2s;
  resize: vertical;
  outline: none;
}

.field input[type="text"]:focus,
.field input[type="email"]:focus,
.field input[type="url"]:focus,
.field textarea:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(201,151,58,0.12);
}

.field input.error,
.field textarea.error {
  border-color: #e05c5c;
  box-shadow: 0 0 0 3px rgba(224,92,92,0.12);
}

.field input::placeholder,
.field textarea::placeholder {
  color: var(--text-muted);
  opacity: 0.7;
}

.field-hint {
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.field-error {
  font-size: 0.8rem;
  color: #e05c5c;
  min-height: 1.2em;
}

/* ── Upload Zone ── */
.upload-zone {
  position: relative;
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  transition: border-color .2s, background .2s;
  cursor: pointer;
  overflow: hidden;
}

.upload-zone:hover,
.upload-zone.drag-over {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.upload-zone input[type="file"] {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
  width: 100%;
  height: 100%;
}

.upload-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 36px 24px;
  text-align: center;
  pointer-events: none;
}

.upload-icon { font-size: 2.2rem; margin-bottom: 10px; }

.upload-title {
  font-size: 0.95rem;
  color: var(--text);
  margin-bottom: 6px;
}

.upload-link { color: var(--accent); font-weight: 600; }

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

.upload-preview {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px 20px;
}

.upload-preview img {
  width: 56px;
  height: 56px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--surface);
}

.upload-preview-info {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
}

.upload-preview-info span {
  font-size: 0.88rem;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.remove-file {
  flex-shrink: 0;
  background: var(--surface-2);
  border: 1px solid var(--border);
  color: var(--text-muted);
  border-radius: 50%;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0.75rem;
  transition: background .15s, color .15s;
}

.remove-file:hover {
  background: rgba(224,92,92,0.15);
  color: #e05c5c;
  border-color: rgba(224,92,92,0.4);
}

/* ── Shape Options ── */
.shape-options {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin-top: 4px;
}

.shape-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 20px 12px 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s, background .2s, transform .15s;
  text-align: center;
  user-select: none;
}

.shape-card input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.shape-card:hover {
  border-color: var(--accent-dim);
  background: var(--surface-2);
}

.shape-card.selected {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.shape-visual {
  width: 52px;
  height: 52px;
  color: var(--accent);
}

.shape-name {
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--text);
}

.shape-desc {
  font-size: 0.75rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.custom-shape-field {
  margin-top: 16px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn .2s ease;
}

.custom-shape-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}

/* ── NFC Toggle ── */
.nfc-toggle-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  background: var(--bg);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  transition: border-color .2s;
}

.nfc-toggle-card.active {
  border-color: var(--accent);
  background: var(--accent-glow);
}

.nfc-toggle-info {
  display: flex;
  align-items: center;
  gap: 14px;
}

.nfc-toggle-icon { font-size: 1.6rem; }

.nfc-toggle-title {
  font-weight: 700;
  font-size: 0.95rem;
  margin-bottom: 3px;
}

.nfc-toggle-desc {
  color: var(--text-muted);
  font-size: 0.82rem;
  line-height: 1.5;
}

/* Toggle switch */
.toggle-switch {
  flex-shrink: 0;
  cursor: pointer;
}

.toggle-switch input { display: none; }

.toggle-track {
  display: block;
  width: 50px;
  height: 28px;
  background: var(--surface-2);
  border: 1.5px solid var(--border);
  border-radius: 50px;
  position: relative;
  transition: background .25s, border-color .25s;
}

.toggle-thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--text-muted);
  transition: transform .25s, background .25s;
}

.toggle-switch input:checked ~ .toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.toggle-switch input:checked ~ .toggle-track .toggle-thumb {
  transform: translateX(22px);
  background: #0d0a07;
}

.nfc-link-field {
  margin-top: 14px;
  padding: 16px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  animation: fadeIn .2s ease;
}

.nfc-link-field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
  display: block;
}

/* ── Submit area ── */
.form-submit {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}

.submit-note {
  color: var(--text-muted);
  font-size: 0.82rem;
  flex: 1;
  min-width: 200px;
}

.submit-btn {
  min-width: 160px;
  justify-content: center;
  font-size: 1rem;
  padding: 14px 36px;
}

.submit-btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none !important;
}

/* Spinner */
.spinner {
  width: 18px;
  height: 18px;
  border: 2px solid rgba(0,0,0,0.25);
  border-top-color: #0d0a07;
  border-radius: 50%;
  animation: spin .7s linear infinite;
  display: inline-block;
}

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

/* ── Success State ── */
.success-state {
  text-align: center;
  padding: 80px 40px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 24px;
}

.success-icon {
  font-size: 3.5rem;
  margin-bottom: 20px;
  animation: popIn .4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes popIn {
  0%   { transform: scale(0.4); opacity: 0; }
  100% { transform: scale(1);   opacity: 1; }
}

.success-state h2 {
  font-size: 1.8rem;
  font-weight: 800;
  margin-bottom: 14px;
}

.success-state p {
  color: var(--text-muted);
  max-width: 460px;
  margin: 0 auto;
  line-height: 1.65;
}

/* ── Sidebar ── */
.order-sidebar {
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
}

.sidebar-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 24px;
}

.sidebar-card h3 {
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 18px;
  color: var(--text);
}

.next-steps {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.next-steps li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.55;
}

.info-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.info-list li {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.5;
}

/* ── Animations ── */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ── Responsive ── */
@media (max-width: 900px) {
  .form-layout {
    grid-template-columns: 1fr;
  }
  .order-sidebar {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }
  .sidebar-card { flex: 1 1 280px; }
}

@media (max-width: 600px) {
  .field-group { grid-template-columns: 1fr; }
  .shape-options { grid-template-columns: 1fr; }
  .form-section { padding: 24px 18px; }
  .form-submit { flex-direction: column; align-items: stretch; }
  .submit-btn { width: 100%; }
}
