/* ===== REGISTRATION POPUP ===== */
.rg-modal {
  position: fixed; inset: 0; z-index: 300;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  background: rgba(16, 42, 67, 0.6);
}
.rg-modal[hidden] { display: none; }

.rg-dialog {
  position: relative;
  width: 100%; max-width: 720px;
  max-height: calc(100vh - 40px);
  max-height: calc(100dvh - 40px);
  display: flex; flex-direction: column;
  overflow: hidden;
  background: #fff;
  border-radius: 20px;
  box-shadow: 0 30px 70px rgba(16, 42, 67, 0.35);
  animation: rgPop .25s ease;
}
@keyframes rgPop { from { opacity: 0; transform: translateY(20px) scale(.98); } to { opacity: 1; transform: none; } }

.rg-head {
  position: relative;
  flex-shrink: 0;
  padding: 24px 70px 20px 28px;
  color: #fff;
  background: linear-gradient(135deg, #1D4ED8, #0F766E);
}
.rg-head h2 { margin: 0 0 4px; font-size: 24px; line-height: 1.25; color: #fff; outline: none; }
.rg-head p { margin: 0; font-size: 14px; color: rgba(255, 255, 255, 0.92); }
.rg-close {
  position: absolute; top: 12px; right: 12px;
  width: 44px; height: 44px;
  font-size: 28px; line-height: 1; color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 0; border-radius: 50%;
  cursor: pointer;
}
.rg-close:hover { background: rgba(255, 255, 255, 0.3); }

.rg-scroll { overflow-y: auto; }
.rg-body { padding: 24px 28px 28px; }

/* ----- error summary ----- */
.rg-summary {
  margin-bottom: 18px;
  padding: 14px 16px;
  font-size: 14px;
  background: #FDECEC;
  border-left: 5px solid #B91C1C;
  border-radius: 10px;
  outline: none;
}
.rg-summary[hidden] { display: none; }
.rg-summary b { display: block; margin-bottom: 4px; color: #B91C1C; }
.rg-summary ul { margin: 0; padding-left: 18px; }
.rg-summary a { color: #B91C1C; text-decoration: underline; }

/* ----- fields ----- */
.rg-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 18px; }
.rg-field { min-width: 0; }
.rg-field.full { grid-column: 1 / -1; }

.rg-field label { display: block; margin-bottom: 6px; font-size: 14px; font-weight: 600; color: var(--navy); }
.rg-field label span { color: #B91C1C; }
.rg-field label em, .rg-check em { font-weight: 400; font-style: normal; color: #627D98; }

.rg-field input,
.rg-field select {
  width: 100%; min-height: 48px;
  padding: 10px 14px;
  font: inherit; font-size: 16px;
  color: var(--text);
  background: #fff;
  border: 1.5px solid #BCCCDC;
  border-radius: 10px;
}
.rg-field input:focus,
.rg-field select:focus { outline: 3px solid rgba(29, 78, 216, 0.25); border-color: var(--blue); }
.rg-field [aria-invalid="true"] { border-color: #B91C1C; background: #FFF8F8; }

.rg-err { display: block; margin-top: 4px; font-size: 13px; color: #B91C1C; }
.rg-err:empty { display: none; }

.rg-trap { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

/* ----- checkboxes ----- */
.rg-checks { margin: 20px 0 6px; padding: 16px; background: #F5F8FC; border-radius: 12px; }
.rg-check { display: flex; align-items: flex-start; gap: 12px; margin-bottom: 4px; padding: 6px 0; font-size: 14px; cursor: pointer; }
.rg-check input { flex-shrink: 0; width: 22px; height: 22px; margin-top: 1px; accent-color: var(--blue); }
.rg-check a { color: var(--blue); text-decoration: underline; }
.rg-check b { color: #B91C1C; }
.rg-checks .rg-err { margin: -2px 0 8px 34px; }

/* ----- submit ----- */
.rg-submit {
  width: 100%; min-height: 52px; margin-top: 16px;
  font: inherit; font-size: 17px; font-weight: 600; color: #fff;
  background: var(--blue);
  border: 0; border-radius: 12px;
  cursor: pointer;
  transition: background .2s ease;
}
.rg-submit:hover { background: var(--blue-dark); }
.rg-submit:disabled { background: #7C97D6; cursor: wait; }
.rg-foot { margin: 12px 0 0; text-align: center; font-size: 13px; }

/* ----- success ----- */
.rg-success { text-align: center; padding: 40px 28px; }
.rg-success[hidden] { display: none; }
.rg-tick {
  width: 72px; height: 72px; margin: 0 auto 18px;
  display: flex; align-items: center; justify-content: center;
  font-size: 36px; color: #fff;
  background: linear-gradient(135deg, #0F766E, #14B8A6);
  border-radius: 50%;
}
.rg-success h3 { margin: 0 0 10px; font-size: 24px; line-height: 1.3; color: var(--navy); outline: none; }
.rg-success p { margin: 0 0 8px; }
.rg-ref { display: inline-block; margin: 8px 0 22px !important; padding: 8px 16px; background: #E2F1EF; border-radius: 999px; font-size: 15px; }
.rg-ref b { color: var(--teal); letter-spacing: .5px; }
.rg-call, .rg-done {
  display: flex; align-items: center; justify-content: center;
  width: 100%; max-width: 320px; min-height: 48px; margin: 0 auto 10px;
  font: inherit; font-size: 16px; font-weight: 600;
  border-radius: 12px; cursor: pointer;
}
.rg-call { color: #fff; background: var(--blue); border: 0; }
.rg-done { color: var(--blue); background: #fff; border: 2px solid var(--blue); }

/* ----- phones: full-screen form ----- */
@media (max-width: 600px) {
  .rg-modal { padding: 0; }
  .rg-dialog { max-width: none; height: 100%; max-height: none; border-radius: 0; }
  .rg-head { padding: 18px 64px 16px 18px; }
  .rg-head h2 { font-size: 21px; }
  .rg-body { padding: 18px 16px 24px; }
  .rg-grid { grid-template-columns: minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) { .rg-dialog { animation: none; } }