/* ==========================================================================
   Shuttle Hub — Login / OTP screens
   Theme tokens
   ========================================================================== */
: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-gradient-soft: linear-gradient(180deg, #dfeeff 0%, #f4f9ff 55%, #ffffff 100%);
  --sh-ink: #1b2436;
  --sh-muted: #7c8798;
  --sh-border: #e7ecf3;
  --sh-surface: #ffffff;
  --sh-mint-bg: #eaf8ee;

  --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-family: var(--sh-font-body);
  font-weight: 600;
  font-size: 0.95rem;
}

.status-bar--dark { color: var(--sh-ink); }
.status-bar--light { color: #ffffff; }

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

/* ==========================================================================
   Screen 1 — Hero (real banner photo)
   ========================================================================== */
.hero-panel--photo {
  position: relative;
  overflow: hidden;
  height: 360px;
  background: #0f172a;
}

.hero-banner-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 15%;
  display: block;
}

.brand-logo {
  width: 74px;
  height: 82px;
  color: var(--sh-navy);
}

.brand-logo--white { color: #ffffff; filter: drop-shadow(0 4px 10px rgba(0,0,0,0.12)); }

/* Small tagline shown once, right where the sheet begins, since the hero
   photo already carries the logo + "Badminton Community" line */
.sheet-tagline {
  text-align: center;
  font-family: var(--sh-font-display);
  font-weight: 600;
  font-size: 0.92rem;
  color: var(--sh-green-dark);
  letter-spacing: 0.4px;
  margin: 14px 0 0;
}

/* ==========================================================================
   Splash screen (brief branded intro before the login form)
   ========================================================================== */
.splash-screen {
  position: absolute;
  inset: 0;
  z-index: 100;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transition: opacity 0.5s ease;
}

.splash-screen.splash-screen--hidden {
  opacity: 0;
  pointer-events: none;
}

.splash-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ==========================================================================
   Sheet — the white rounded panel that overlaps the hero
   ========================================================================== */
.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);
}

/* ---- field label row ---- */
.field-label-row {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 14px;
}

.field-icon {
  width: 42px;
  height: 42px;
  min-width: 42px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
}

.field-icon--green {
  background: var(--sh-mint-bg);
  color: var(--sh-green-dark);
}

.field-title {
  font-family: var(--sh-font-display);
  font-weight: 600;
  font-size: 1rem;
  margin: 0;
  color: var(--sh-ink);
}

.field-subtitle {
  font-size: 0.82rem;
  color: var(--sh-muted);
  margin: 2px 0 0;
}

/* ---- phone input group ---- */
.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: 14px 16px;
  color: var(--sh-ink);
}

.phone-input:focus {
  box-shadow: none;
}

.phone-input::placeholder { color: #a8b2c1; }

.invalid-feedback-text {
  display: none;
  color: #dc3545;
  font-size: 0.78rem;
  margin-top: 6px;
  padding-left: 4px;
}

.phone-input-group.is-invalid { border-color: #dc3545; }
.phone-input-group.is-invalid ~ .invalid-feedback-text { display: block; }

/* ---- gradient CTA button ---- */
.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;
}

/* ---- divider ---- */
.divider-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 22px 0 20px;
}

.divider-line {
  flex: 1;
  height: 1px;
  background: var(--sh-border);
}

.divider-label {
  font-size: 0.8rem;
  color: var(--sh-muted);
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* ---- trust row (3 features) ---- */
.trust-row {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  padding-bottom: 24px;
}

.trust-item {
  flex: 1;
  text-align: center;
}

.trust-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: var(--sh-mint-bg);
  color: var(--sh-green-dark);
  font-size: 1.15rem;
  margin-bottom: 8px;
}

.trust-title {
  font-family: var(--sh-font-display);
  font-weight: 600;
  font-size: 0.82rem;
  margin: 0 0 3px;
  color: var(--sh-ink);
}

.trust-subtitle {
  font-size: 0.72rem;
  line-height: 1.3;
  color: var(--sh-muted);
  margin: 0;
}

/* ---- register banner ---- */
.register-banner {
  background: #f4f6f9;
  text-align: center;
  padding: 18px 20px;
  margin: 0 16px;
  border-radius: var(--sh-radius-md);
}

.register-question {
  font-size: 0.86rem;
  color: var(--sh-muted);
  margin: 0 0 2px;
}

.register-link {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 0.98rem;
  color: var(--sh-navy);
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ---- legal text ---- */
.legal-text {
  text-align: center;
  font-size: 0.74rem;
  color: var(--sh-muted);
  line-height: 1.6;
  margin: 16px 0 22px;
}

.legal-text a {
  color: var(--sh-blue);
  font-weight: 600;
}

/* ==========================================================================
   Password field (toggle visibility button)
   ========================================================================== */
.password-toggle-btn {
  background: #ffffff;
  border: none;
  color: var(--sh-muted);
  padding: 0 16px;
  font-size: 1rem;
}

.password-toggle-btn:hover,
.password-toggle-btn:focus {
  color: var(--sh-ink);
  background: #ffffff;
}

.forgot-password-row {
  text-align: right;
  margin-top: 8px;
}

.forgot-password-link {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sh-blue);
}

/* ==========================================================================
   Screen 2 — OTP
   ========================================================================== */
.otp-header {
  position: relative;
  background: var(--sh-gradient);
  padding: 6px 22px 46px;
  color: #ffffff;
}

.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;
  margin: 6px 0 10px;
}

.otp-header-content {
  text-align: center;
  padding: 6px 8px 4px;
}

.otp-title {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1.5rem;
  margin: 14px 0 8px;
}

.otp-subtitle {
  font-size: 0.9rem;
  opacity: 0.9;
  margin: 0 0 2px;
}

.otp-phone {
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1.05rem;
  margin: 2px 0 0;
  letter-spacing: 0.5px;
}

.app-sheet--otp {
  margin-top: -34px;
}

.otp-instruction {
  text-align: center;
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1rem;
  margin-bottom: 20px;
}

.otp-input-row {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 22px;
}

.otp-box {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 52px;
  text-align: center;
  font-family: var(--sh-font-display);
  font-weight: 700;
  font-size: 1.25rem;
  border: 1.5px solid var(--sh-border);
  border-radius: var(--sh-radius-sm);
  color: var(--sh-ink);
  background: #ffffff;
  transition: border-color .15s ease, box-shadow .15s ease;
}

.otp-box:focus {
  outline: none;
  border-color: var(--sh-blue-light);
  box-shadow: 0 0 0 3px rgba(47, 118, 199, 0.15);
}

.otp-box.filled {
  border-color: var(--sh-navy);
}

.resend-row {
  text-align: center;
  margin-bottom: 20px;
}

.resend-text {
  font-size: 0.85rem;
  color: var(--sh-muted);
  margin: 0;
}

.resend-timer-row {
  font-size: 0.85rem;
  color: var(--sh-ink);
  margin: 2px 0 0;
}

.resend-timer {
  color: var(--sh-green-dark);
  font-weight: 700;
}

.resend-btn {
  border: none;
  background: none;
  color: var(--sh-blue);
  font-weight: 700;
  font-size: 0.9rem;
  padding: 0;
  margin-top: 2px;
}

/* ---- security note ---- */
.security-note {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  background: var(--sh-mint-bg);
  border-radius: var(--sh-radius-md);
  padding: 14px 16px;
  margin: 18px 0 6px;
}

.security-note-icon {
  color: var(--sh-green-dark);
  font-size: 1.05rem;
  margin-top: 1px;
}

.security-note p {
  margin: 0;
  font-size: 0.82rem;
  color: #33513c;
  line-height: 1.45;
}

/* ---- racket footer illustration ---- */
.racket-footer {
  margin-top: auto;
  padding: 18px 0 0;
  background: linear-gradient(180deg, #ffffff 0%, #eaf2fb 100%);
  border-radius: 0 0 0 0;
}

.racket-illustration {
  width: 100%;
  display: block;
  filter: drop-shadow(0 -4px 10px rgba(20, 60, 120, 0.06));
}

.racket-footer::before {
  content: "";
  display: block;
  width: 120px;
  height: 4px;
  background: #10141c;
  border-radius: 4px;
  margin: 0 auto 10px;
  opacity: 0.85;
}

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

@media (min-width: 431px) {
  .app-viewport { background: #e9edf3; }
}

/* 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,
  .hero-shuttle--fly { transition: none !important; animation: none !important; }
}
