/* ==========================================================================
   Registration modal
   ========================================================================== */
.reg-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  background: rgba(10, 20, 12, .6);
  padding: 20px;
}
.reg-modal-overlay.open { display: flex; }
body.reg-modal-locked { overflow: hidden; }

.reg-modal {
  width: 100%;
  max-width: 640px;
  max-height: 92vh;
  overflow-y: auto;
  background: var(--cream-soft, #fdf3e9);
  border-radius: 18px;
  box-shadow: 0 30px 70px -20px rgba(0,0,0,.5);
}

.reg-modal-header {
  position: relative;
  background: var(--green, #1b3a24);
  padding: 20px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-radius: 18px 18px 0 0;
  overflow: hidden;
}
.reg-modal-logo { height: 40px; width: auto; }
.reg-modal-close {
  background: none;
  border: none;
  color: #fff;
  font-size: 1.8rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.reg-modal-body { padding: 28px 28px 32px; }
.reg-modal-body h2 {
  font-family: var(--font-display, serif);
  color: var(--ink, #22201d);
  font-size: 1.5rem;
  margin: 0 0 18px;
}

/* Upload box */
.reg-upload {
  display: block;
  position: relative;
  border: 2px dashed #c9bfa8;
  border-radius: 12px;
  padding: 26px 20px;
  text-align: center;
  cursor: pointer;
  margin-bottom: 8px;
  transition: border-color .2s ease, background .2s ease;
}
.reg-upload:hover, .reg-upload.dragover { border-color: var(--green, #1b3a24); background: rgba(27,58,36,.04); }
.reg-upload-icon { width: 34px; height: 34px; fill: none; stroke: #6b6255; stroke-width: 1.6; margin-bottom: 8px; }
.reg-upload-inner p { margin: 4px 0; font-size: .92rem; color: #3a352f; }
.reg-upload-sub { font-size: .78rem !important; color: #8a8175 !important; }
.reg-upload-preview {
  max-width: 140px;
  max-height: 140px;
  border-radius: 8px;
  object-fit: cover;
  margin: 0 auto;
}

/* Fields */
.reg-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px 24px;
  margin-top: 18px;
}
.reg-field-full { grid-column: 1 / -1; }
.reg-field { margin-bottom: 10px; }
.reg-field input, .reg-field select {
  width: 100%;
  border: none;
  border-bottom: 1px solid #c9bfa8;
  background: transparent;
  padding: 10px 2px;
  font-size: .95rem;
  font-family: inherit;
  color: var(--ink, #22201d);
}
.reg-field select { appearance: none; -webkit-appearance:none; background-image:url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23555'><path d='M6 9l6 6 6-6'/></svg>"); background-repeat:no-repeat; background-position:right 2px center; background-size:16px; }
.reg-field input:focus, .reg-field select:focus { outline: none; border-bottom-color: var(--green, #1b3a24); }
.reg-field input::placeholder { color: #746b5d; }

.reg-error { color: #b3261e; font-size: .78rem; margin: 3px 0 0; min-height: 1em; }
.reg-error:empty { display: none; }
.reg-error-general { text-align: center; font-size: .88rem; margin: 10px 0 0; }

.reg-consent {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-top: 18px;
  font-size: .84rem;
  color: #3a352f;
  line-height: 1.5;
  cursor: pointer;
}
.reg-consent input { margin-top: 3px; flex-shrink: 0; }

.reg-submit {
  display: block;
  width: 100%;
  margin-top: 22px;
  padding: 14px;
  border: none;
  border-radius: 10px;
  background: var(--green, #1b3a24);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  transition: background .2s ease;
}
.reg-submit:hover { background: var(--green-dark, #12291a); }
.reg-submit:disabled { opacity: .6; cursor: not-allowed; }

/* Loading step */
#regStepLoading { text-align: center; padding: 40px 0; }
.reg-spinner {
  width: 44px; height: 44px; margin: 0 auto 18px;
  border: 4px solid #e5dcc9; border-top-color: var(--green, #1b3a24);
  border-radius: 50%;
  animation: reg-spin 0.8s linear infinite;
}
@keyframes reg-spin { to { transform: rotate(360deg); } }

/* Success step */
.reg-step-success { text-align: center; padding: 10px 0 0; }
.reg-success-icon {
  width: 56px; height: 56px; line-height: 56px; margin: 0 auto 12px;
  border-radius: 50%; background: #1e7d34; color: #fff; font-size: 1.6rem;
}
.reg-step-success h2 { color: var(--green, #1b3a24); }
.reg-success-qr { width: 180px; height: 180px; margin: 16px auto; display: block; border: 1px solid #e5dcc9; border-radius: 8px; }
.reg-success-code { font-weight: 700; color: #3a352f; margin-bottom: 4px; }

@media (max-width: 560px) {
  .reg-grid { grid-template-columns: 1fr; }
  .reg-modal-body { padding: 22px 18px 26px; }
}
