/* ==========================================================================
   Shuttle Hub — Player Registration screen
   Theme tokens (kept in sync with login.css)
   ========================================================================== */
:root {
  --sh-navy: #123a7c;
  --sh-blue: #16509a;
  --sh-blue-light: #2f76c7;
  --sh-green: #1fa952;
  --sh-green-dark: #17843f;
  --sh-gradient: linear-gradient(120deg, var(--sh-navy) 0%, var(--sh-blue) 45%, var(--sh-green) 100%);
  --sh-ink: #1b2436;
  --sh-muted: #7c8798;
  --sh-border: #e7ecf3;
  --sh-surface: #ffffff;
  --sh-mint-bg: #eaf8ee;
  --sh-danger: #dc3545;

  --sh-font-display: 'Poppins', sans-serif;
  --sh-font-body: 'Inter', sans-serif;

  --sh-radius-lg: 28px;
  --sh-radius-md: 16px;
  --sh-radius-sm: 12px;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  font-family: var(--sh-font-body);
  color: var(--sh-ink);
  background: #e9edf3;
  -webkit-font-smoothing: antialiased;
}

a { text-decoration: none; }

/* ==========================================================================
   App viewport — centers a phone-sized app shell like a native Android app
   ========================================================================== */
.app-viewport {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px 12px;
}

.app-shell {
  position: relative;
  width: 100%;
  max-width: 430px;
  min-height: 900px;
  background: var(--sh-surface);
  border-radius: 40px;
  overflow: hidden;
  box-shadow: 0 30px 60px -20px rgba(15, 35, 75, 0.35), 0 0 0 10px #10141c;
}

.app-screen {
  display: flex;
  flex-direction: column;
  min-height: 900px;
}

/* ==========================================================================
   Status bar
   ========================================================================== */
.status-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 26px 6px;
  font-weight: 600;
  font-size: 0.95rem;
}

.status-bar--light { color: #ffffff; }
.status-icons { display: flex; align-items: center; gap: 6px; font-size: 0.95rem; }

/* ==========================================================================
   Header
   ========================================================================== */
.reg-header {
  background: var(--sh-gradient);
  color: #ffffff;
  padding: 4px 22px 46px;
}

.reg-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 6px;
}

.back-btn {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.15);
  color: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  text-decoration: none;
}

.reg-header-brand .brand-logo--white {
  width: 34px;
  height: 38px;
  color: #ffffff;
}

.reg-header-content {
  text-align: center;
  padding: 14px 6px 0;
}

.reg-title {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1.4rem;
  margin: 0 0 6px;
}

.reg-subtitle {
  font-size: 0.86rem;
  opacity: 0.9;
  margin: 0;
}

/* ==========================================================================
   Sheet
   ========================================================================== */
.app-sheet {
  position: relative;
  z-index: 3;
  background: var(--sh-surface);
  border-radius: var(--sh-radius-lg) var(--sh-radius-lg) 0 0;
  margin-top: -26px;
  flex: 1;
  display: flex;
  flex-direction: column;
  box-shadow: 0 -12px 30px -20px rgba(15, 35, 75, 0.25);
}

.app-sheet--reg { padding-bottom: 8px; }

/* progress dots */
.reg-steps {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin-bottom: 22px;
}

.reg-step {
  width: 28px;
  height: 5px;
  border-radius: 4px;
  background: var(--sh-border);
}

.reg-step--active { background: var(--sh-green); }

/* ==========================================================================
   Form fields
   ========================================================================== */
.form-field { margin-bottom: 18px; }

.form-field-label {
  display: inline-block;
  font-family: var(--sh-font-display);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--sh-ink);
  margin-bottom: 8px;
}

.field-optional-tag {
  font-family: var(--sh-font-body);
  font-weight: 500;
  font-size: 0.7rem;
  color: var(--sh-muted);
  background: #f1f4f8;
  padding: 2px 8px;
  border-radius: 20px;
  margin-left: 4px;
  vertical-align: middle;
}

/* icon input group (name, age, email) */
.icon-input-group {
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.icon-input-group:focus-within {
  border-color: var(--sh-blue-light);
  box-shadow: 0 0 0 3px rgba(47, 118, 199, 0.15);
}

.icon-input-addon {
  background: #ffffff;
  border: none;
  border-right: 1.5px solid var(--sh-border);
  color: var(--sh-green-dark);
  font-size: 0.95rem;
  padding: 0 14px;
}

.icon-input {
  border: none;
  font-size: 0.96rem;
  padding: 13px 14px;
  color: var(--sh-ink);
}

.icon-input:focus { box-shadow: none; }
.icon-input::placeholder { color: #a8b2c1; }

/* phone input group (reuses login pattern) */
.phone-input-group {
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  overflow: hidden;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.phone-input-group:focus-within {
  border-color: var(--sh-blue-light);
  box-shadow: 0 0 0 3px rgba(47, 118, 199, 0.15);
}

.country-code-btn {
  background: #ffffff;
  border: none;
  border-right: 1.5px solid var(--sh-border);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--sh-ink);
  padding: 0 16px;
  border-radius: 0;
}

.country-code-btn:focus,
.country-code-btn:active {
  box-shadow: none !important;
  background: #ffffff !important;
  color: var(--sh-ink) !important;
}

.phone-input {
  border: none;
  border-radius: 0;
  font-size: 0.98rem;
  padding: 13px 14px;
  color: var(--sh-ink);
}

.phone-input:focus { box-shadow: none; }
.phone-input::placeholder { color: #a8b2c1; }

/* field error text */
.field-error {
  display: none;
  color: var(--sh-danger);
  font-size: 0.76rem;
  margin: 6px 0 0;
  padding-left: 4px;
}

.icon-input-group.is-invalid,
.phone-input-group.is-invalid { border-color: var(--sh-danger); }

.icon-input-group.is-invalid ~ .field-error,
.phone-input-group.is-invalid ~ .field-error { display: block; }

/* ==========================================================================
   Gender pill selector
   ========================================================================== */
.gender-pill-group {
  display: flex;
  gap: 6px;
}

.gender-pill {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius-md);
  padding: 9px 4px;
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--sh-muted);
  cursor: pointer;
  transition: all .15s ease;
}

.gender-pill i { font-size: 1.05rem; }

.btn-check:checked + .gender-pill {
  border-color: var(--sh-green);
  background: var(--sh-mint-bg);
  color: var(--sh-green-dark);
}

.gender-pill-group.is-invalid .gender-pill {
  border-color: var(--sh-danger);
}

.gender-pill-group.is-invalid ~ .field-error { display: block; }

/* ==========================================================================
   Fitness declaration
   ========================================================================== */
.declaration-box {
  display: flex;
  gap: 12px;
  background: var(--sh-mint-bg);
  border: 1.5px solid #cdeed7;
  border-radius: var(--sh-radius-md);
  padding: 16px;
  margin-top: 4px;
  transition: border-color .15s ease;
}

.declaration-box.is-invalid {
  border-color: var(--sh-danger);
  background: #fdf1f2;
}

.declaration-icon {
  width: 38px;
  height: 38px;
  min-width: 38px;
  border-radius: 50%;
  background: #ffffff;
  color: var(--sh-green-dark);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
}

.declaration-title {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 0.92rem;
  margin: 0 0 6px;
  color: var(--sh-ink);
}

.declaration-text {
  font-size: 0.78rem;
  line-height: 1.55;
  color: #3f5348;
  margin: 0 0 12px;
}

.declaration-check {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding-left: 0;
  margin-left: 0;
}

.declaration-check .form-check-input {
  margin-top: 2px;
  width: 1.05em;
  height: 1.05em;
  border-color: var(--sh-green);
}

.declaration-check .form-check-input:checked {
  background-color: var(--sh-green);
  border-color: var(--sh-green);
}

.declaration-check .form-check-input:focus {
  box-shadow: 0 0 0 3px rgba(31, 169, 82, 0.2);
}

.declaration-check .form-check-label {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sh-ink);
}

#declarationError { margin-top: 8px; margin-bottom: 0; }

/* ==========================================================================
   Gradient button (shared visual language with login)
   ========================================================================== */
.btn-gradient {
  background: var(--sh-gradient);
  border: none;
  color: #ffffff;
  font-family: var(--sh-font-display);
  font-weight: 600;
  font-size: 1.02rem;
  border-radius: var(--sh-radius-md);
  padding: 15px 20px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  box-shadow: 0 12px 24px -10px rgba(20, 90, 90, 0.45);
  transition: transform .15s ease, box-shadow .15s ease, opacity .15s ease;
}

.btn-gradient:hover,
.btn-gradient:focus {
  color: #ffffff;
  transform: translateY(-1px);
  box-shadow: 0 16px 28px -10px rgba(20, 90, 90, 0.55);
}

.btn-gradient:active { transform: translateY(0); }

.btn-gradient:disabled,
.btn-gradient.is-disabled {
  opacity: 0.55;
  pointer-events: none;
}

/* ==========================================================================
   Footer link
   ========================================================================== */
.legal-text {
  text-align: center;
  font-size: 0.82rem;
  color: var(--sh-muted);
  margin: 18px 0 22px;
}

.reg-login-link {
  color: var(--sh-navy);
  font-weight: 700;
  margin-left: 4px;
}

/* ==========================================================================
   Success overlay
   ========================================================================== */
.success-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 25, 45, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}

.success-card {
  background: #ffffff;
  border-radius: var(--sh-radius-lg);
  padding: 34px 26px 26px;
  max-width: 340px;
  width: 100%;
  text-align: center;
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.4);
}

.success-icon {
  width: 70px;
  height: 70px;
  border-radius: 50%;
  background: var(--sh-mint-bg);
  color: var(--sh-green-dark);
  font-size: 2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 18px;
}

.success-title {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1.2rem;
  margin: 0 0 8px;
  color: var(--sh-ink);
}

.success-text {
  font-size: 0.85rem;
  color: var(--sh-muted);
  line-height: 1.5;
  margin: 0 0 22px;
}

/* ==========================================================================
   Responsive tweaks
   ========================================================================== */
@media (max-width: 400px) {
  .app-shell { border-radius: 0; box-shadow: none; }
  .app-viewport { padding: 0; }
}

/* Focus visibility for accessibility */
a:focus-visible,
button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--sh-blue-light);
  outline-offset: 2px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .btn-gradient { transition: none !important; }
}
