:root {
  --primary: #2563eb;
  --primary-hover: #1d4ed8;
  --success: #16a34a;
  --warning: #ca8a04;
  --error: #dc2626;
  --bg: #f8fafc;
  --card-bg: #ffffff;
  --text: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --radius: 12px;
  --shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
}

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

@media (max-width: 640px) {
  .container {
    padding: 1rem;
  }
}

/* Hero Section */
.hero {
  text-align: center;
  padding: 3rem 0;
}

.hero h1 {
  font-size: 2.5rem;
  margin-bottom: 0.5rem;
}

.hero p {
  font-size: 1.25rem;
  color: var(--text-muted);
}

/* Use Cases Grid */
.use-cases {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 2rem 0;
}

.use-case-card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  text-decoration: none;
  color: inherit;
  transition: all 0.2s;
  display: block;
}

.use-case-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}

.use-case-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
}

.use-case-card h2 {
  font-size: 1.25rem;
  margin-bottom: 0.5rem;
}

.use-case-card p {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin-bottom: 1rem;
}

.badge {
  display: inline-block;
  background: var(--bg);
  padding: 0.25rem 0.75rem;
  border-radius: 2rem;
  font-size: 0.75rem;
  font-weight: 500;
  color: var(--primary);
}

/* Footer */
footer {
  text-align: center;
  padding: 2rem 0;
  color: var(--text-muted);
  font-size: 0.875rem;
}

footer a {
  color: var(--primary);
  text-decoration: none;
}

footer a:hover {
  text-decoration: underline;
}

/* Demo Page Layout */
.demo-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
  min-height: calc(100vh - 200px);
}

@media (max-width: 900px) {
  .demo-container {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }
}

.demo-left,
.demo-right {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .demo-left,
  .demo-right {
    padding: 1.25rem;
    border-radius: 8px;
  }
}

.demo-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border);
}

.demo-header a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 1.5rem;
  transition: transform 0.2s;
}

.demo-header a:hover {
  transform: translateX(-2px);
}

.demo-header h1 {
  font-size: 1.5rem;
}

@media (max-width: 640px) {
  .demo-header h1 {
    font-size: 1.25rem;
  }
}

/* Site Header */
header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 2rem;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 100;
  backdrop-filter: blur(8px);
}

header .logo {
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

header .logo:hover {
  opacity: 0.8;
}

header .badge {
  font-size: 0.75rem;
  padding: 0.25rem 0.75rem;
  background: var(--primary);
  color: white;
  border-radius: 999px;
}

@media (max-width: 640px) {
  header {
    padding: 0.75rem 1rem;
  }

  header .logo {
    font-size: 1rem;
  }

  header .badge {
    font-size: 0.65rem;
    padding: 0.2rem 0.5rem;
  }
}

/* QR Code Section */
.qr-section {
  text-align: center;
  padding: 2rem;
}

@media (max-width: 640px) {
  .qr-section {
    padding: 1.5rem;
  }
}

.qr-section h2 {
  font-size: 1rem;
  color: var(--text-muted);
  margin-bottom: 1.5rem;
}

.qr-placeholder {
  width: 200px;
  height: 200px;
  max-width: 100%;
  background: var(--bg);
  border: 2px dashed var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1.5rem;
  color: var(--text-muted);
}

.qr-placeholder canvas {
  display: block;
}

.qr-placeholder.has-qr {
  border: none;
  background: white;
  padding: 1rem;
  box-shadow: var(--shadow);
}

/* Status */
.status {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border-radius: 2rem;
  font-weight: 500;
  background: var(--bg);
}

.status.waiting {
  color: var(--warning);
}

.status.success {
  background: #dcfce7;
  color: var(--success);
}

.status.error {
  background: #fee2e2;
  color: var(--error);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: currentColor;
  animation: pulse 1.5s infinite;
}

.status.success .status-dot,
.status.error .status-dot {
  animation: none;
}

@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Buttons */
.btn {
  display: inline-block;
  padding: 0.875rem 1.75rem;
  border: none;
  border-radius: var(--radius);
  font-size: 1rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  text-align: center;
}

.btn-primary {
  background: var(--primary);
  color: white;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
}

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--border);
}

.btn-block {
  display: block;
  width: 100%;
}

@media (max-width: 640px) {
  .btn {
    min-height: 48px;
  }
}

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

.form-group label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.5rem;
}

.form-group input,
.form-group select {
  width: 100%;
  padding: 0.75rem 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 1rem;
}

.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

/* Result Display */
.result-panel {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-top: 1.5rem;
}

.result-panel h3 {
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}

.credential-item {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  margin-bottom: 0.5rem;
}

.credential-item:last-child {
  margin-bottom: 0;
}

.credential-label {
  font-size: 0.75rem;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.credential-value {
  font-size: 1.125rem;
  font-weight: 500;
}

/* Messages */
.message {
  padding: 1rem;
  border-radius: var(--radius);
  margin-bottom: 1rem;
}

.message.success {
  background: #dcfce7;
  color: var(--success);
}

.message.error {
  background: #fee2e2;
  color: var(--error);
}

.message.info {
  background: #dbeafe;
  color: var(--primary);
}

/* Card (common) */
.card {
  background: var(--card-bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
  box-shadow: var(--shadow);
}

@media (max-width: 640px) {
  .card {
    padding: 1.25rem;
    border-radius: 8px;
  }
}

/* QR Container (common) */
.qr-container {
  text-align: center;
  padding: 2rem;
  background: var(--bg);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

@media (max-width: 640px) {
  .qr-container {
    padding: 1.5rem 1rem;
  }
}

.qr-code {
  display: inline-block;
  background: white;
  padding: 1rem;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.qr-code canvas {
  display: block;
  max-width: 100%;
  height: auto;
}

.status-text {
  margin-top: 1rem;
  color: var(--text-muted);
  font-size: 0.875rem;
}

/* Privacy Note (common) */
.privacy-note {
  background: #dbeafe;
  padding: 1rem;
  border-radius: var(--radius);
  font-size: 0.875rem;
}

.privacy-note strong {
  display: block;
  margin-bottom: 0.5rem;
  color: var(--primary);
}

.privacy-note p {
  margin: 0;
  color: var(--text);
}

/* Responsive Tables/Lists */
@media (max-width: 480px) {
  .result-item,
  .booking-item,
  .cart-item {
    flex-direction: column;
    gap: 0.25rem;
    align-items: flex-start;
  }
}

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

.card,
.demo-left,
.demo-right {
  animation: fadeIn 0.3s ease-out;
}

/* Hidden utility */
.hidden {
  display: none !important;
}
