@import url('https://fonts.googleapis.com/css2?family=Inter:wght@500;600;700;800&display=swap');

:root {
  --ink: #0b1f35;
  --muted: #6b7280;
  --accent: #0f4fa8;
  --accent-2: #0ea7a6;
  --bg: #f6f8fb;
  --card: #ffffff;
  --border: #d9dfeb;
  --shadow: 0 16px 44px rgba(11, 31, 53, 0.12);
  --error: #b91c1c;
  --success: #0f9d58;
}

#v2-reg-page, #v2-reg-page * { box-sizing: border-box; }
#v2-reg-page {
  min-height: 100vh;
  font-family: 'Inter','Helvetica Neue',sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 12% 8%, rgba(15,79,168,0.08), transparent 22%),
    radial-gradient(circle at 86% 14%, rgba(14,167,166,0.10), transparent 18%),
    var(--bg);
  display: flex;
  align-items: flex-start;
  justify-content: center;
  padding: 120px 16px 60px;
}

.reg-shell {
  width: min(1020px, 100%);
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 18px;
  box-shadow: var(--shadow);
  padding: 28px;
}

@media (min-width: 768px) {
  .reg-shell { padding: 34px; }
}

.reg-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: flex-start;
  flex-wrap: wrap;
}

.reg-head h1 {
  margin: 6px 0 10px;
  font-size: clamp(28px, 4vw, 34px);
  letter-spacing: -0.02em;
  font-weight: 800;
}

.reg-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
  max-width: 680px;
  font-size: 15px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: #e7efff;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  font-size: 12px;
}

.reg-body {
  margin-top: 26px;
  display: grid;
  grid-template-columns: 1fr;
  gap: 22px;
}

.pill {
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #e6eaf2;
  background: #f9fbff;
  font-weight: 700;
  color: var(--ink);
  font-size: 13px;
}

.pill + .pill { margin-top: 10px; }

.reg-card {
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 24px 22px 26px;
  background: linear-gradient(150deg, rgba(15,79,168,0.04), rgba(14,167,166,0.03)), #fff;
}

.reg-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px 18px;
}
.reg-grid.is-hidden {
  display: none;
}
.reg-step-actions {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}
.reg-step2 {
  margin-top: 22px;
  display: grid;
  gap: 18px;
}
.reg-step2.is-hidden {
  display: none;
}

label {
  display: block;
  font-weight: 700;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.label-required::after {
  content: " *";
  color: var(--error);
  font-weight: 800;
}

.input {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  padding: 12px 13px;
  font-size: 15px;
  color: var(--ink);
  background: #fff;
  transition: border-color .16s ease, box-shadow .16s ease;
}

.input--ghost::placeholder {
  color: rgba(11, 31, 53, 0.35);
  font-weight: 600;
}

.input:focus {
  outline: none;
  border-color: rgba(15,79,168,0.5);
  box-shadow: 0 0 0 3px rgba(15,79,168,0.12);
}

.password-field {
  position: relative;
}

.password-field__input {
  padding-right: 88px;
}

.password-toggle {
  position: absolute;
  top: 50%;
  right: 10px;
  transform: translateY(-50%);
  border: 0;
  background: transparent;
  color: var(--accent);
  cursor: pointer;
  padding: 6px;
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
}

.password-toggle__icon {
  width: 20px;
  height: 20px;
}

.password-toggle__icon.is-hidden {
  display: none;
}

.password-toggle:hover {
  background: rgba(15,79,168,0.08);
}

.password-toggle:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(15,79,168,0.14);
}

.password-rules {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 6px 12px;
  margin-top: 9px;
}
.password-rules span {
  position: relative;
  padding-left: 20px;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.4;
}
.password-rules span::before {
  position: absolute;
  top: 0;
  left: 0;
  content: "○";
  color: #94a3b8;
  font-weight: 800;
}
.password-rules span.is-valid {
  color: #166534;
}
.password-rules span.is-valid::before {
  content: "✓";
  color: var(--success);
}
.password-rules span.is-invalid {
  color: var(--error);
}
.password-rules span.is-invalid::before {
  content: "×";
  color: var(--error);
}
.password-match {
  min-height: 17px;
  margin: 7px 0 0;
  font-size: 12px;
  font-weight: 700;
}
.password-match.is-valid { color: #166534; }
.password-match.is-invalid { color: var(--error); }

@media (max-width: 520px) {
  .password-rules { grid-template-columns: 1fr; }
}

.note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.6;
}

.hint {
  color: var(--muted);
  font-size: 12px;
  margin-top: 6px;
}

.suggest-box {
  position: relative;
}

.suggest-list {
  position: absolute;
  z-index: 40;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: 12px;
  margin-top: 6px;
  max-height: 220px;
  overflow: auto;
  box-shadow: 0 16px 32px rgba(11,31,53,0.12);
}

.suggest-item {
  padding: 10px 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--ink);
}

.suggest-item:hover { background: #f7f8fb; }
.suggest-item--inactive {
  background: #fff7ed;
}
.suggest-item--inactive:hover {
  background: #ffedd5;
}
.reg-selection-note {
  display: none;
  margin-top: 10px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid #fde68a;
  background: #fffbeb;
  color: #92400e;
  font-size: 13px;
  line-height: 1.55;
}
.reg-selection-note.is-visible {
  display: block;
}

.check-row {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px;
  align-items: flex-start;
}

.reg-newsletter-option {
  display: grid;
  grid-template-columns: 42px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  padding: 6px 2px 2px;
}
.reg-newsletter-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 13px;
  background: #eef2f7;
  color: #475569;
  transition: color .2s ease, background-color .2s ease;
}
.reg-newsletter-icon svg {
  width: 21px;
  height: 21px;
}
.reg-newsletter-copy {
  color: #334155;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}
.reg-newsletter-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 12px;
  background: #fff;
  padding: 9px 14px;
  color: #334155;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: transform .2s ease, border-color .2s ease, background-color .2s ease, box-shadow .2s ease;
}
.reg-newsletter-button:hover {
  border-color: #94a3b8;
  background: #f1f5f9;
  transform: translateY(-1px);
}
.reg-newsletter-button:focus-visible {
  outline: none;
  border-color: #94a3b8;
  box-shadow: 0 0 0 3px rgba(148, 163, 184, .2);
}
.reg-newsletter-button.is-active {
  border-color: #86b99b;
  background: #f0f9f4;
  color: #17603a;
}
.reg-newsletter-option.is-active .reg-newsletter-icon {
  background: #dcf3e5;
  color: #16804a;
}
.reg-newsletter-check {
  display: none;
  width: 16px;
  height: 16px;
}
.reg-newsletter-button.is-active .reg-newsletter-check {
  display: block;
}

@media (max-width: 640px) {
  .reg-newsletter-option {
    grid-template-columns: 42px minmax(0, 1fr);
  }
  .reg-newsletter-button {
    grid-column: 1 / -1;
    width: 100%;
  }
}

.feedback {
  margin-top: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid transparent;
  font-weight: 700;
  display: none;
}
.feedback.ok { display: block; background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.feedback.ko { display: block; background: #fef2f2; border-color: #fecdd3; color: var(--error); }

.status {
  display: none;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid transparent;
  font-weight: 700;
}
.status.ok { display: block; background: #ecfdf3; border-color: #bbf7d0; color: #166534; }
.status.err { display: block; background: #fef2f2; border-color: #fecdd3; color: var(--error); }

.status-actions {
  display: none;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 12px;
}

.status-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 190px;
  padding: 12px 16px;
  border-radius: 12px;
  font-weight: 800;
  text-decoration: none;
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}

.status-action:hover {
  transform: translateY(-1px);
}

.status-action--primary {
  background: linear-gradient(120deg, #1351b4, #0ea7a6);
  color: #fff;
  box-shadow: 0 14px 30px rgba(15,79,168,0.22);
}

.status-action--ghost {
  background: #fff;
  color: #1351b4;
  border: 1px solid rgba(19,81,180,0.22);
}

.cta {
  margin-top: 6px;
  width: 100%;
  background: linear-gradient(120deg, #1351b4, #0ea7a6);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px 16px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 30px rgba(15,79,168,0.22);
  transition: transform .16s ease, box-shadow .16s ease, opacity .16s ease;
}
.cta:hover { transform: translateY(-1px); box-shadow: 0 16px 34px rgba(15,79,168,0.26); }
.cta:active { transform: translateY(0); }
.cta[disabled] { opacity: 0.6; cursor: not-allowed; }
.cta--secondary {
  margin-top: 0;
  width: auto;
  min-width: 220px;
}

.footer {
  margin-top: 14px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 13px;
}

.footer a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

body.registration-modal-open { overflow: hidden; }
.registration-modal[hidden] { display: none; }
.registration-modal {
  position: fixed;
  z-index: 10000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 20px;
}
.registration-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(4, 20, 39, 0.72);
  backdrop-filter: blur(4px);
}
.registration-modal__panel {
  position: relative;
  width: min(500px, 100%);
  padding: 34px 30px 28px;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 30px 80px rgba(4, 20, 39, 0.34);
  text-align: center;
}
.registration-modal__icon {
  display: grid;
  width: 68px;
  height: 68px;
  place-items: center;
  margin: 0 auto 18px;
  border-radius: 50%;
  color: #fff;
  background: var(--success);
  font-size: 34px;
  font-weight: 800;
  box-shadow: 0 12px 28px rgba(15,157,88,0.25);
}
.registration-modal__panel h2 {
  margin: 0 0 12px;
  color: var(--ink);
  font-size: clamp(24px, 5vw, 30px);
  line-height: 1.2;
}
.registration-modal__panel > p {
  margin: 0;
  color: #435368;
  font-size: 16px;
  line-height: 1.6;
}
.registration-modal__spam {
  margin-top: 16px !important;
  padding: 13px 14px;
  border-radius: 12px;
  background: #fff7df;
  color: #714d00 !important;
  font-size: 14px !important;
}
.registration-modal__button {
  display: flex;
  min-height: 50px;
  align-items: center;
  justify-content: center;
  margin-top: 22px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(120deg, #1351b4, #0ea7a6);
  font-weight: 800;
  text-decoration: none;
  box-shadow: 0 14px 30px rgba(15,79,168,0.22);
}
.registration-modal__panel small {
  display: block;
  margin-top: 12px;
  color: var(--muted);
  font-size: 11px;
}
