/* Shared styling for public product-pass views */
:root {
  color-scheme: light;
}

body.public-shell {
  margin: 0;
  min-height: 100vh;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: linear-gradient(180deg, #f7fafc 0%, #eef2ff 100%);
  color: #0f172a;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover,
a:focus {
  text-decoration: underline;
}

.public-wrapper {
  max-width: 1040px;
  margin: 0 auto;
  padding: 48px 16px 64px;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.brand-header,
.public-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  text-align: center;
}

.public-header {
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.header-actions {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: center;
}

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(12px);
}

.brand-logo {
  max-height: 64px;
  width: auto;
}

.brand-fallback {
  font-weight: 600;
  font-size: 1.25rem;
  letter-spacing: 0.01em;
}

.brand-welcome {
  max-width: 560px;
  margin: 0;
  color: #475569;
  line-height: 1.5;
}

.public-card {
  background: rgba(255, 255, 255, 0.92);
  border-radius: 20px;
  padding: 32px;
  box-shadow: 0 22px 45px rgba(30, 64, 175, 0.12);
  backdrop-filter: blur(16px);
}

.public-card h1,
.public-card h2 {
  margin-top: 0;
  color: #1e293b;
}

.card-subtitle {
  margin-top: 8px;
  margin-bottom: 24px;
  color: #475569;
  line-height: 1.6;
}

.search-form,
.stack-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-label {
  font-size: 0.9rem;
  font-weight: 600;
  color: #1e293b;
}

.field-input {
  border: 1px solid rgba(148, 163, 184, 0.6);
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.field-input:focus {
  outline: none;
  border-color: #4338ca;
  box-shadow: 0 0 0 3px rgba(99, 102, 241, 0.2);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 999px;
  padding: 12px 20px;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease;
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

.button.primary {
  color: #fff;
  background: linear-gradient(135deg, #4338ca 0%, #6366f1 100%);
  box-shadow: 0 12px 25px rgba(79, 70, 229, 0.25);
}

.button.primary:hover,
.button.primary:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 16px 32px rgba(79, 70, 229, 0.32);
}

.button.secondary {
  background: #e0e7ff;
  color: #312e81;
}

.button.secondary:hover,
.button.secondary:focus-visible {
  background: #c7d2fe;
}

.button.ghost {
  background: transparent;
  border: 1px solid rgba(99, 102, 241, 0.45);
  color: #4338ca;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  background: rgba(99, 102, 241, 0.08);
}

.button.full {
  width: 100%;
}

.button.is-loading::after {
  content: '';
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.6);
  border-top-color: rgba(255, 255, 255, 1);
  border-radius: 999px;
  animation: spin 0.8s linear infinite;
}

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

.search-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  justify-content: center;
}

.scan-preview {
  margin-top: 24px;
  border: 1px solid rgba(148, 163, 184, 0.4);
  border-radius: 16px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.8);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.scan-preview.is-active {
  border-color: rgba(99, 102, 241, 0.6);
  box-shadow: 0 16px 32px rgba(99, 102, 241, 0.18);
}

.scan-video {
  width: 100%;
  border-radius: 12px;
}

.scan-hint {
  margin: 0;
  font-size: 0.9rem;
  color: #475569;
}

.notice {
  margin: 0;
  padding: 16px 20px;
  border-radius: 16px;
  font-weight: 600;
  text-align: center;
}

.notice-success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.notice-error {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.pass-card {
  padding: 0;
  overflow: hidden;
}

.pass-preview {
  width: 100%;
  min-height: 320px;
  padding: 32px;
  background: #fff;
  overflow-x: auto;
}

.auth-wrapper {
  gap: 32px;
}

.auth-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 24px;
  align-items: start;
}

.auth-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-card {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.preview-card h2 {
  margin: 0;
}

.form-feedback {
  margin: 0;
  padding: 12px 16px;
  border-radius: 12px;
  font-size: 0.95rem;
}

.form-feedback[data-visible='false'] {
  display: none;
}

.feedback-success {
  background: rgba(34, 197, 94, 0.12);
  color: #166534;
}

.feedback-error {
  background: rgba(248, 113, 113, 0.16);
  color: #b91c1c;
}

.feedback-info {
  background: rgba(59, 130, 246, 0.12);
  color: #1d4ed8;
}

.auth-links {
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 0.95rem;
}

.public-footer {
  text-align: center;
  color: #64748b;
  font-size: 0.9rem;
}

@media (max-width: 768px) {
  .public-wrapper {
    padding: 32px 16px 48px;
  }

  .public-card {
    padding: 24px;
  }

  .pass-preview {
    padding: 24px;
  }

  .public-header {
    flex-direction: column;
    align-items: center;
  }
}
