* {
  box-sizing: border-box;
}

body {
  font-family: "Inter", "Segoe UI", system-ui, sans-serif;
  background: radial-gradient(circle at top, #f0fbff, #e4f2ff 55%, #d9e1ff);
  min-height: 100vh;
  margin: 0;
  display: grid;
  place-items: center;
}

.card {
  background: rgba(255, 255, 255, 0.96);
  border-radius: 1.2rem;
  padding: 2rem;
  width: min(480px, 90vw);
  box-shadow: 0 25px 80px rgba(20, 41, 74, 0.15);
  text-align: center;
}

h1 {
  margin-top: 0;
  margin-bottom: 0.25rem;
  color: #0f172a;
}

.lead {
  color: #334155;
  margin-top: 0;
  margin-bottom: 1.5rem;
}

.controls {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
  justify-content: center;
  margin-bottom: 1rem;
}

.button {
  border: none;
  padding: 0.75rem 1.4rem;
  border-radius: 999px;
  background: #0ea5e9;
  color: white;
  cursor: pointer;
  font-weight: 600;
  position: relative;
  overflow: hidden;
}

.button.secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.button input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}

.preview {
  position: relative;
  min-height: 220px;
  border-radius: 1rem;
  border: 2px dashed #94a3b8;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f8fafc;
  margin-bottom: 1rem;
}

.preview img,
.preview video {
  max-width: 100%;
  max-height: 320px;
  border-radius: 1rem;
}

#status {
  margin: 0;
  padding: 0.75rem;
  border-radius: 0.75rem;
  background: #f1f5f9;
  color: #0f172a;
  font-size: 0.95rem;
}

.match-info {
  margin: 0.35rem 0 0.9rem;
  font-size: 0.95rem;
  font-weight: 600;
  color: #0f172a;
}

.form-grid {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.form-grid label {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  font-size: 0.9rem;
  color: #475569;
}

.form-grid input,
.form-grid textarea {
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  padding: 0.5rem 0.75rem;
  font-size: 1rem;
  font-family: inherit;
  background: #fff;
  outline: none;
  transition: border 0.2s ease;
}

.form-grid input:focus,
.form-grid textarea:focus {
  border-color: #0ea5e9;
}

.upload-button {
  position: relative;
  cursor: pointer;
}

.upload-button input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}

.submit-button {
  width: 100%;
  justify-self: stretch;
}

.mode-label {
  margin: 0.5rem 0 0.9rem;
  font-size: 0.95rem;
  color: #475569;
}

.capture-btn {
  display: block;
  width: 100%;
  margin-bottom: 1rem;
}

.tabs {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
}

.tab {
  flex: 1;
  padding: 0.65rem 0;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  cursor: pointer;
  background: #e2e8f0;
  color: #0f172a;
  transition: background 0.2s ease, color 0.2s ease;
}

.tab.active {
  background: #0ea5e9;
  color: #fff;
}

.login-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  z-index: 20;
}

.login-overlay.visible {
  display: flex;
}

.login-card {
  background: #fff;
  border-radius: 1rem;
  padding: 2rem;
  width: min(420px, 90vw);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.25);
  text-align: center;
}

.login-card form {
  display: grid;
  gap: 0.75rem;
  text-align: left;
}

.login-card label {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  font-weight: 600;
  color: #0f172a;
}

.login-card input {
  border-radius: 0.5rem;
  border: 1px solid #cbd5f5;
  padding: 0.6rem 0.75rem;
  font-family: inherit;
}

.status-text {
  margin-top: 1rem;
  font-size: 0.9rem;
  color: #0f172a;
}

.status-text.status-error {
  color: #b91c1c;
}

.status-text.status-ok {
  color: #047857;
}

