/**
 * Register — 2-step flow: details → email verify
 */

.reg-card-wrap {
  width: min(420px, 100%);
}

.reg-card {
  padding: 1.15rem 1.45rem 1.1rem !important;
  max-height: calc(100dvh - var(--nav-height) - 1rem);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  min-height: 0;
}

.reg-card #alert {
  flex-shrink: 0;
  margin-bottom: 0.5rem;
  position: sticky;
  top: 0;
  z-index: 3;
}

.reg-card #alert:empty {
  margin: 0;
}

/* Step indicator */
.reg-steps {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0 0 0.85rem;
  padding: 0;
}

.reg-step {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex: 1;
  min-width: 0;
}

.reg-step-num {
  width: 1.55rem;
  height: 1.55rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.72rem;
  font-weight: 800;
  color: #6a8578;
  background: rgba(88, 179, 143, 0.12);
  border: 1px solid rgba(88, 179, 143, 0.28);
  border-radius: 50%;
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}

.reg-step-label {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #6a8578;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s;
}

.reg-step.is-active .reg-step-num {
  color: #000;
  background: #00ff85;
  border-color: #00ff85;
}

.reg-step.is-active .reg-step-label {
  color: #00ff85;
}

.reg-step.is-done .reg-step-num {
  color: #00ff85;
  background: rgba(0, 255, 133, 0.12);
  border-color: rgba(0, 255, 133, 0.45);
}

.reg-step.is-done .reg-step-num::after {
  content: '✓';
  font-size: 0.65rem;
}

.reg-step.is-done .reg-step-num {
  font-size: 0;
}

.reg-step-line {
  flex: 0 0 1.25rem;
  height: 1px;
  background: rgba(88, 179, 143, 0.25);
}

.reg-phase {
  display: none;
  flex-direction: column;
  gap: 0;
  min-height: min-content;
}

.reg-phase.active {
  display: flex;
  flex: 1;
  min-height: 0;
  flex-direction: column;
}

.reg-card-scroll {
  flex: 1;
  min-height: 0;
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 255, 133, 0.35) transparent;
  margin: 0 -0.15rem;
  padding: 0 0.15rem 0.35rem;
}

.reg-card-scroll::-webkit-scrollbar {
  width: 4px;
}

.reg-card-scroll::-webkit-scrollbar-thumb {
  background: rgba(0, 255, 133, 0.35);
  border-radius: 4px;
}

.reg-card-actions {
  flex-shrink: 0;
  padding-top: 0.5rem;
  border-top: 1px solid rgba(88, 179, 143, 0.12);
  background: linear-gradient(180deg, transparent 0%, rgba(6, 8, 7, 0.92) 18%);
}

.reg-section {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding-bottom: 0.15rem;
}

.reg-section + .reg-section {
  margin-top: 0.35rem;
  padding-top: 0.55rem;
  border-top: 1px solid rgba(88, 179, 143, 0.1);
}

.reg-section-label {
  margin: 0 0 0.1rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(0, 255, 133, 0.75);
}

.reg-row-2--stack {
  grid-template-columns: 1fr;
}

.auth-page .form-group .pw-input-wrap input {
  width: 100%;
}

.reg-head {
  text-align: left;
  margin: 0 0 0.75rem;
  padding: 0;
  border: none;
}

.reg-head h1 {
  margin: 0 0 0.3rem;
  font-size: 1.4rem;
  font-weight: 800;
  color: #fff;
  line-height: 1.2;
}

.reg-sub {
  margin: 0;
  font-size: 0.86rem;
  color: #8fa89a;
  line-height: 1.45;
}

.reg-form {
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  padding-bottom: 0.15rem;
}

.reg-row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55rem;
}

.reg-field {
  display: flex;
  flex-direction: column;
  gap: 0.32rem;
}

.reg-field label {
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #8fa89a;
}

.reg-field input,
.reg-field select {
  width: 100%;
  min-height: 44px;
  padding: 0.55rem 0.8rem;
  font-size: 0.92rem;
  color: #f0f0f0;
  background: #0a0a0a;
  border: 1px solid rgba(88, 179, 143, 0.32);
  border-radius: 10px;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.reg-field input:focus,
.reg-field select:focus {
  outline: none;
  border-color: #00ff85;
  box-shadow: 0 0 0 3px rgba(0, 255, 133, 0.12);
}

.reg-field input::placeholder {
  color: #6a8578;
}

.reg-field input:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* Password rules */
.reg-pw-rules {
  margin: 0;
  padding: 0.45rem 0.65rem;
  list-style: none;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.25rem 0.5rem;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(88, 179, 143, 0.18);
  border-radius: 10px;
}

.reg-pw-rules li {
  font-size: 0.68rem;
  color: #6a8578;
  padding-left: 1rem;
  position: relative;
  line-height: 1.35;
}

.reg-pw-rules li::before {
  content: '○';
  position: absolute;
  left: 0;
  color: #5a7568;
  font-size: 0.55rem;
  top: 0.15rem;
}

.reg-pw-rules li.is-ok {
  color: #00ff85;
}

.reg-pw-rules li.is-ok::before {
  content: '●';
  color: #00ff85;
}

/* Country */
.reg-country-wrap {
  position: relative;
}

.reg-country-badge {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.35rem;
  pointer-events: none;
  z-index: 1;
}

.reg-country-badge.is-empty {
  display: none;
}

.reg-country-flag {
  font-size: 1.05rem;
  line-height: 1;
}

.reg-country-iso {
  min-width: 1.5rem;
  font-size: 0.62rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  color: #00ff85;
  text-align: center;
}

.reg-country-wrap select {
  padding-left: 4.5rem !important;
  appearance: none;
  cursor: pointer;
  font-family: system-ui, -apple-system, "Segoe UI", "Segoe UI Emoji", "Apple Color Emoji", "Noto Color Emoji", sans-serif;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%2358b38f' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.85rem center;
  padding-right: 2.25rem;
}

/* Phone */
.reg-phone-row {
  display: grid;
  grid-template-columns: 3.25rem 1fr;
  gap: 0.5rem;
  align-items: stretch;
}

.reg-phone-dial {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #8fa89a;
  background: #0a0a0a;
  border: 1px solid rgba(88, 179, 143, 0.32);
  border-radius: 10px;
}

.reg-phone-row.has-dial .reg-phone-dial {
  color: #00ff85;
  border-color: rgba(0, 255, 133, 0.4);
}

/* Currency */
.reg-currency-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.4rem;
}

.reg-currency-opt {
  min-height: 48px;
  padding: 0.4rem 0.3rem;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.08rem;
  font-weight: 800;
  color: #8fa89a;
  background: #0a0a0a;
  border: 1px solid rgba(88, 179, 143, 0.28);
  border-radius: 10px;
  cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}

.reg-cur-code {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
}

.reg-cur-sym {
  font-size: 0.66rem;
  opacity: 0.9;
}

.reg-currency-opt.active {
  color: #00ff85;
  border-color: rgba(0, 255, 133, 0.55);
  background: rgba(0, 255, 133, 0.06);
}

.reg-currency-note {
  margin: 0.3rem 0 0;
  font-size: 0.7rem;
  color: #7a9588;
  line-height: 1.4;
}

.reg-check {
  display: flex;
  gap: 0.5rem;
  align-items: flex-start;
  font-size: 0.72rem;
  line-height: 1.4;
  color: #9eb8ac;
  cursor: pointer;
}

.reg-check input {
  margin-top: 0.15rem;
  flex-shrink: 0;
}

.reg-check a {
  color: #00ff85;
}

/* Email sent panel — phase 2 */
.reg-email-sent {
  display: flex;
  gap: 0.75rem;
  align-items: flex-start;
  padding: 0.85rem 0.9rem;
  margin-bottom: 0.65rem;
  background: rgba(0, 255, 133, 0.06);
  border: 1px solid rgba(0, 255, 133, 0.28);
  border-radius: 12px;
}

.reg-email-sent-icon {
  flex-shrink: 0;
  width: 2.25rem;
  height: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #00ff85;
  background: rgba(0, 255, 133, 0.1);
  border-radius: 10px;
}

.reg-email-sent-icon svg {
  width: 1.25rem;
  height: 1.25rem;
}

.reg-email-sent-title {
  margin: 0 0 0.15rem;
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #00ff85;
}

.reg-email-sent-addr {
  margin: 0 0 0.35rem;
  font-size: 0.9rem;
  font-weight: 700;
  color: #fff;
  word-break: break-all;
}

.reg-email-sent-hint {
  margin: 0;
  font-size: 0.72rem;
  color: #8fa89a;
  line-height: 1.45;
}

.reg-email-sent-hint strong {
  color: #c5d9ce;
  font-weight: 700;
}

/* OTP */
.reg-otp-row {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0.38rem;
}

.reg-otp-digit {
  height: 46px;
  padding: 0;
  text-align: center;
  font-size: 1.15rem;
  font-weight: 800;
  color: #fff;
  background: #0a0a0a;
  border: 1px solid rgba(88, 179, 143, 0.35);
  border-radius: 10px;
}

.reg-otp-digit:focus {
  outline: none;
  border-color: #00ff85;
  box-shadow: 0 0 0 2px rgba(0, 255, 133, 0.15);
}

.reg-mini-hint {
  margin: 0.35rem 0 0;
  font-size: 0.72rem;
  color: #8fa89a;
}

.auth-inline-link {
  background: none;
  border: none;
  padding: 0;
  font: inherit;
  color: #00ff85;
  font-weight: 700;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.auth-inline-link:disabled {
  opacity: 0.5;
  cursor: wait;
}

/* Buttons */
.reg-continue-btn {
  width: 100%;
  min-height: 48px;
  margin-top: 0.45rem;
  padding: 0 1.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-size: 0.94rem;
  font-weight: 800;
  color: #000;
  background: linear-gradient(135deg, #00ff85 0%, #00d4aa 50%, #00ff85 100%);
  border: none;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 255, 133, 0.35);
  transition: filter 0.2s, transform 0.15s;
  flex-shrink: 0;
}

.reg-continue-btn:hover:not(:disabled) {
  filter: brightness(1.06);
}

.reg-continue-btn:disabled {
  opacity: 0.65;
  cursor: wait;
}

.reg-continue-btn svg {
  width: 18px;
  height: 18px;
}

.reg-foot-link {
  margin: 0.75rem 0 0;
  text-align: center;
  font-size: 0.84rem;
  color: #9eb8ac;
  flex-shrink: 0;
}

.reg-foot-link a {
  color: #00ff85;
  font-weight: 700;
  text-decoration: none;
}

.reg-back-btn {
  width: 100%;
  margin-top: 0.45rem;
  min-height: 40px;
  font-size: 0.82rem;
  font-weight: 700;
  color: #9eb8ac;
  background: transparent;
  border: 1px solid rgba(88, 179, 143, 0.25);
  border-radius: 10px;
  cursor: pointer;
}

.reg-back-btn:hover {
  border-color: rgba(0, 255, 133, 0.4);
  color: #c5d9ce;
}

.auth-page--register .auth-card-accent {
  margin: -1.5rem -1.6rem 1rem;
}

.auth-page--register .auth-card-head,
.auth-page--register .auth-card-eyebrow {
  display: none;
}

.auth-page--register .auth-panel {
  overflow-y: auto;
  overflow-x: hidden;
  align-items: center;
  justify-content: flex-start;
  padding: 0.75rem 0;
  -webkit-overflow-scrolling: touch;
}

.auth-page--register .reg-card-wrap {
  margin: auto 0;
}

@media (max-width: 900px) {
  .reg-card {
    padding: 0.85rem 1rem 0.75rem !important;
    max-height: calc(100dvh - var(--nav-height) - 0.35rem);
    border-radius: 18px;
  }

  .reg-card-wrap {
    width: 100%;
    max-width: min(440px, 100%);
  }

  .reg-head {
    text-align: center;
    margin-bottom: 0.65rem;
  }

  .reg-head h1 {
    font-size: 1.32rem;
  }

  .reg-sub {
    font-size: 0.8rem;
    max-width: 28rem;
    margin: 0 auto;
  }

  .reg-steps {
    justify-content: center;
    margin-bottom: 0.75rem;
    padding: 0.45rem 0.55rem;
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(88, 179, 143, 0.14);
    border-radius: 12px;
  }

  .reg-step {
    flex: 0 1 auto;
    justify-content: center;
  }

  .reg-step-label {
    font-size: 0.64rem;
  }

  .reg-card-actions {
    position: sticky;
    bottom: 0;
    z-index: 4;
    margin: 0 -1rem -0.75rem;
    padding: 0.65rem 1rem max(0.75rem, env(safe-area-inset-bottom));
    border-top: 1px solid rgba(0, 255, 133, 0.18);
    background: linear-gradient(180deg, rgba(6, 8, 7, 0.55) 0%, rgba(6, 8, 7, 0.98) 28%);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
  }

  .reg-card-actions .reg-continue-btn {
    margin-top: 0;
    min-height: 50px;
    font-size: 0.96rem;
    box-shadow: 0 10px 32px rgba(0, 255, 133, 0.38);
  }

  .reg-foot-link {
    margin-top: 0.55rem;
    margin-bottom: 0;
  }

  .reg-field input,
  .reg-field select {
    font-size: 16px;
    min-height: 46px;
  }

  .reg-currency-row {
    gap: 0.45rem;
  }

  .reg-currency-opt {
    min-height: 50px;
  }

  .reg-check {
    padding: 0.55rem 0.6rem;
    background: rgba(0, 0, 0, 0.28);
    border: 1px solid rgba(88, 179, 143, 0.14);
    border-radius: 10px;
  }
}

@media (max-width: 480px) {
  .reg-row-2 {
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .reg-pw-rules {
    grid-template-columns: 1fr;
  }

  .reg-currency-opt {
    min-height: 44px;
  }

  .reg-otp-row {
    gap: 0.28rem;
  }

  .reg-otp-digit {
    height: 42px;
    font-size: 1.05rem;
  }

  .reg-step-label {
    font-size: 0.58rem;
    max-width: 4.5rem;
    white-space: normal;
    line-height: 1.2;
    text-align: center;
  }

  .reg-step-line {
    flex: 0 0 0.75rem;
  }

  .reg-section-label {
    text-align: center;
  }
}

@media (max-width: 360px) {
  .reg-otp-digit {
    height: 38px;
    font-size: 0.95rem;
  }
}
