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

:root {
  --bg-color: #0f172a;
  --surface-color: rgba(30, 41, 59, 0.7);
  --primary-color: #f97316; /* Orange */
  --primary-hover: #ea580c;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --border-color: rgba(255, 255, 255, 0.1);
  --accent-staff: #3b82f6; /* Blue */
  --accent-delivery: #10b981; /* Green */
}

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

body {
  font-family: 'Inter', sans-serif;
  background-color: var(--bg-color);
  color: var(--text-main);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background-image: radial-gradient(circle at top right, rgba(249, 115, 22, 0.15), transparent 400px),
                    radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.15), transparent 400px);
}

.container {
  width: 100%;
  max-width: 800px;
  padding: 2rem;
  margin: 0 auto;
}

header {
  text-align: center;
  margin-bottom: 3rem;
}

h1 {
  font-size: 2.5rem;
  font-weight: 700;
  margin-bottom: 0.5rem;
  background: linear-gradient(to right, #f97316, #fcd34d);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.subtitle {
  color: var(--text-muted);
  font-size: 1.1rem;
}

/* Glassmorphism Card */
.card {
  background: var(--surface-color);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 2rem;
  box-shadow: 0 8px 32px 0 rgba(0, 0, 0, 0.3);
  margin-bottom: 2rem;
}

/* QR Code Section */
.qr-container {
  display: flex;
  justify-content: space-around;
  flex-wrap: wrap;
  gap: 2rem;
}

.qr-box {
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  padding: 1.5rem;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-color);
  transition: transform 0.3s ease;
}

.qr-box:hover {
  transform: translateY(-5px);
}

.qr-box h2 {
  font-size: 1.5rem;
}

.qr-box.staff h2 { color: var(--accent-staff); }
.qr-box.delivery h2 { color: var(--accent-delivery); }

.qr-code {
  background: white;
  padding: 1rem;
  border-radius: 8px;
}

/* Form Styles */
.form-group {
  margin-bottom: 1.5rem;
}

label {
  display: block;
  margin-bottom: 0.5rem;
  font-weight: 600;
  color: var(--text-muted);
}

input[type="text"],
input[type="number"],
select {
  width: 100%;
  padding: 0.75rem 1rem;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.2);
  border: 1px solid var(--border-color);
  color: var(--text-main);
  font-size: 1rem;
  transition: border-color 0.3s;
}

input:focus, select:focus {
  outline: none;
  border-color: var(--primary-color);
}

.checkbox-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

input[type="checkbox"] {
  width: 18px;
  height: 18px;
  accent-color: var(--primary-color);
}

.hidden {
  display: none !important;
}

/* Camera & Signature */
.camera-container, .signature-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1rem;
  background: rgba(0,0,0,0.2);
  padding: 1rem;
  border-radius: 8px;
  border: 1px solid var(--border-color);
}

video {
  width: 100%;
  max-width: 320px;
  border-radius: 8px;
  background: #000;
}

canvas.photo-canvas {
  max-width: 320px;
  border-radius: 8px;
}

canvas.signature-pad {
  background: #fff;
  border-radius: 8px;
  width: 100%;
  height: 200px;
  touch-action: none;
}

.btn {
  padding: 0.75rem 1.5rem;
  border: none;
  border-radius: 8px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s;
  background: var(--primary-color);
  color: #fff;
}

.btn:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
}

.btn-secondary {
  background: rgba(255,255,255,0.1);
  border: 1px solid var(--border-color);
}

.btn-secondary:hover {
  background: rgba(255,255,255,0.2);
}

.btn-block {
  width: 100%;
  margin-top: 1rem;
  padding: 1rem;
  font-size: 1.1rem;
}

.contract-text {
  font-size: 0.9rem;
  color: var(--text-muted);
  background: rgba(0,0,0,0.3);
  padding: 1rem;
  border-radius: 8px;
  max-height: 200px;
  overflow-y: auto;
  margin-bottom: 1rem;
  white-space: pre-wrap;
}

#contract-preview {
  background: white;
  color: black;
  padding: 2rem;
  border-radius: 8px;
}

#contract-preview h3 { color: black; margin-bottom: 1rem; }
#contract-preview p { color: #333; margin-bottom: 0.5rem; }
