/* Generic form layout shared across pages */

.form-wrapper {
  width: 100%;
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  justify-content: center;
}

.form-card {
  width: 100%;
  max-width: 420px;
  background-color: #ffffff;
  border-radius: 8px;
  padding: 20px 22px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.12);
  box-sizing: border-box;
}

.form-card h2 {
  margin: 0 0 10px 0;
  font-size: 20px;
  font-weight: 600;
}

/* Labels & fields */

label {
  display: block;
  margin-top: 10px;
  margin-bottom: 4px;
  font-size: 13px;
  font-weight: 500;
  color: #374151;
}

input,
select,
textarea {
  width: 100%;
  padding: 8px 9px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  font-size: 13px;
  box-sizing: border-box;
  background-color: #ffffff;
  font-family: inherit;
}

input:focus,
select:focus,
textarea:focus {
  outline: none;
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.1);
}

/* Buttons */

.btn {
  display: inline-block;
  margin-top: 14px;
  padding: 8px 10px;
  text-align: center;
  border-radius: 4px;
  border: none;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  box-sizing: border-box;
}

.btn-primary {
  background-color: #2563eb;
  color: #ffffff;
}

.btn-secondary {
  background-color: #6b7280;
  color: #ffffff;
}

/* Errors, success */

.form-error {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 10px;
  background-color: #fee2e2;
  color: #b91c1c;
  font-size: 12px;
  border-radius: 4px;
}

.form-success {
  margin-top: 8px;
  margin-bottom: 4px;
  padding: 8px 10px;
  background-color: #dcfce7;
  color: #166534;
  font-size: 12px;
  border-radius: 4px;
}

/* QR preview */

.qr-preview {
  margin-top: 14px;
  text-align: center;
}

.qr-thumb {
  width: 96px;
  height: 96px;
  object-fit: contain;
}

/* Centered layout helper */

.form-page-center {
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Color input styling */

input[type="color"] {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding: 0;
  width: 44px;
  height: 30px;
  border-radius: 4px;
  border: 1px solid #d1d5db;
  background: transparent;
  cursor: pointer;
  box-sizing: border-box;
}

input[type="color"]::-webkit-color-swatch-wrapper {
  padding: 0;
  border-radius: 4px;
}

input[type="color"]::-webkit-color-swatch {
  border-radius: 4px;
  border: none;
}

input[type="color"]::-moz-color-swatch {
  border-radius: 4px;
  border: none;
}

/* =========================
   New: field groups & radio/checkbox layout
   ========================= */

.field-group {
  margin-top: 10px;
}

.field-group > label {
  margin-top: 0;
}

/* Inline radio pill row for "QR content" selector */

.radio-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 6px;
}

.radio-row label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid #d1d5db;
  background-color: #f9fafb;
  font-size: 12px;
  font-weight: 400;
  color: #374151;
  cursor: pointer;
  white-space: nowrap;
}

.radio-row input[type="radio"] {
  margin: 0;
  width: 14px;
  height: 14px;
}

/* Inline checkbox label (for "Hidden network" etc.) */

.checkbox-inline {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 6px;
  font-size: 12px;
  color: #374151;
  cursor: pointer;
}

.checkbox-inline input[type="checkbox"] {
  margin: 0;
  width: 14px;
  height: 14px;
}

/* Helper text */

.field-hint {
  font-size: 10px;
  color: #9ca3af;
  margin: 2px 0 0 0;
}

/* =========================
   Expiry controls
   ========================= */

.expiry-group {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid #e5e7eb;
}

.expiry-group .checkbox-inline {
  font-weight: 500;
  color: #111827;
}

.expiry-fields {
  margin-top: 8px;
}
