/* Landing and authentication screen --------------------------------------- */

.landing-page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0;
}

.pilot-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  margin: 0;
  padding: 0;
  background: url('../assets/landing-background.png') center top / cover no-repeat;
}

.pilot-screen__overlay {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0;
  background: rgba(0, 0, 0, 0.4);
}

.pilot-screen__content {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 56rem;
  min-height: 100vh;
  display: flex;
  flex: 1;
  flex-direction: column;
  margin: 0 auto;
  padding: 1rem 1.5rem 1.5rem;
}

.pilot-screen__logo-wrap {
  display: flex;
  justify-content: center;
  margin-bottom: 0.5rem;
}

.pilot-screen__logo {
  width: 10rem;
  height: 10rem;
  object-fit: contain;
}

.pilot-screen__spacer { flex: 1; }

.pilot-screen__launch {
  width: 100%;
  max-width: 28rem;
  margin: 0 auto 1rem;
  padding: 1.25rem 1rem;
  border: 0;
  border-radius: 0.75rem;
  color: #fff;
  background: var(--ps-primary, #22c55e);
  box-shadow: 0 0 30px rgba(34, 197, 94, 0.6), 0 0 60px rgba(34, 197, 94, 0.4),
    0 0 90px rgba(34, 197, 94, 0.2);
  font-family: var(--ps-font-heading, system-ui);
  font-size: clamp(1.8rem, 5vw, 3rem);
  font-weight: 900;
  line-height: 1.1;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffd700,
    0 0 40px #ffa500;
  transition: transform 150ms ease;
}

.pilot-screen__launch:hover { transform: scale(1.05); }

.pilot-screen__tagline {
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--ps-font-body, system-ui);
  font-size: 0.875rem;
  text-align: center;
}

.auth-screen {
  position: relative;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 2rem 1.5rem;
  background: url('../assets/landing-background.png') center / cover no-repeat;
}

.auth-panel {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 28rem;
  text-align: center;
  animation: landing-fade-in 300ms ease forwards;
}

@keyframes landing-fade-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

.auth-panel__logo-area { margin-bottom: 1rem; padding-top: 1rem; }
.auth-panel__install { position: absolute; top: 1rem; right: 0; }
.auth-install-button {
  min-height: 2.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  border: 0;
  border-radius: 9999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  font-size: 0.875rem;
  transition: background-color 150ms ease, opacity 150ms ease;
}
.auth-install-button:hover { background: rgba(255, 255, 255, 0.2); }
.auth-install-button svg { width: 1rem; height: 1rem; }
.auth-panel__hero-logo { width: 12rem; height: 12rem; margin: 0 auto; }
.auth-panel__hero-logo img,
.auth-form__logo { width: 100%; height: 100%; object-fit: contain; filter: drop-shadow(0 4px 20px rgba(0, 0, 0, 0.4)); }

.auth-options { margin-top: auto; padding-top: 2rem; }
.auth-options__stack { display: flex; flex-direction: column; gap: 0.75rem; }

.auth-google-button,
.auth-biometric-button,
.auth-choice-button,
.auth-submit-button {
  width: 100%;
  border: 0;
}

.auth-google-button {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border: 2px solid #e7e5e4;
  border-radius: 0.75rem;
  color: #44403c;
  background: #fff;
  box-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -4px rgba(0, 0, 0, 0.1);
  font-size: 1.125rem;
  font-weight: 700;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}
.auth-google-button:hover {
  border-color: #fbbf24;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.auth-google-button svg { width: 1.5rem; height: 1.5rem; }

.auth-divider { display: flex; align-items: center; gap: 0.75rem; padding: 0.5rem 0; }
.auth-divider__line { height: 1px; flex: 1; background: rgba(255, 255, 255, 0.4); }
.auth-divider__label { color: rgba(255, 255, 255, 0.7); font-size: 0.875rem; font-weight: 700; letter-spacing: 0.05em; text-transform: uppercase; }

.auth-biometric-button {
  min-height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  padding: 1rem 1.5rem;
  border-radius: 0.75rem;
  color: #fff;
  background: linear-gradient(to right, #2563eb, #1d4ed8);
  box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  font-size: 1.125rem;
  font-weight: 700;
  transition: opacity 150ms ease, filter 150ms ease;
}
.auth-biometric-button:hover { filter: brightness(0.92); }
.auth-biometric-button:disabled { opacity: 0.5; }
.auth-biometric-button > [data-biometric-idle] { display: inline-flex; align-items: center; justify-content: center; gap: 0.75rem; }
.auth-biometric-button svg { width: 1.5rem; height: 1.5rem; }

.auth-choice-button,
.auth-submit-button {
  border-radius: 0.75rem;
  color: #fff;
  font-family: var(--ps-font-heading, system-ui);
  font-weight: 900;
  letter-spacing: -0.025em;
  text-transform: uppercase;
  text-shadow: 0 0 10px #ffd700, 0 0 20px #ffd700, 0 0 30px #ffd700;
  transition: transform 150ms ease, opacity 150ms ease;
}
.auth-choice-button { padding: 1.25rem 1.5rem; font-size: clamp(1.4rem, 4vw, 2rem); }
.auth-choice-button:hover,
.auth-submit-button:hover { transform: scale(1.05); }
.auth-choice-button--login,
.auth-submit-button { background: #15803d; box-shadow: 0 0 20px rgba(34, 197, 94, 0.5), 0 0 40px rgba(34, 197, 94, 0.3); }
.auth-choice-button--register { background: #f59e0b; box-shadow: 0 0 20px rgba(245, 158, 11, 0.5), 0 0 40px rgba(245, 158, 11, 0.3); }

.auth-spinner {
  width: 2rem;
  height: 2rem;
  margin: 0 auto;
  border: 3px solid hsl(30 6% 90%);
  border-top-color: hsl(145 80% 20%);
  border-radius: 50%;
  animation: auth-spinner 800ms linear infinite;
}
.auth-spinner--large { width: 2rem; height: 2rem; }
@keyframes auth-spinner { to { transform: rotate(360deg); } }

.auth-form-panel { width: 100%; padding-top: 1.5rem; }
.auth-form-panel > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.auth-form__logo-wrap { width: 7rem; height: 7rem; margin: 0 auto 0.5rem; }
.auth-form__subtitle {
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  font-size: 1rem;
  text-align: center;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}

.auth-form-card {
  overflow: hidden;
  border: 0;
  border-radius: 1rem;
  text-align: left;
  box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 8px 10px -6px rgba(0, 0, 0, 0.1);
}
.auth-form-card__content { padding: 1.25rem; background: rgba(255, 255, 255, 0.97); }
.auth-form__required-note { margin: 0 0 0.75rem; color: #78716c; font-size: 0.75rem; line-height: 1rem; }
.auth-form { display: block; }
.auth-form > :not([hidden]) ~ :not([hidden]) { margin-top: 0.75rem; }
.auth-field { display: block; }
.auth-field > :not([hidden]) ~ :not([hidden]) { margin-top: 0.25rem; }
.auth-field__label { color: #57534e; font-size: 0.875rem; line-height: 1.25rem; }
.auth-field__required { color: #ef4444; }
.auth-field__optional { color: #a8a29e; font-size: 0.75rem; }
.auth-field__input {
  height: 2.75rem;
  border-color: #e7e5e4;
  color: #1c1917;
  background-color: #fff;
  padding: 0.25rem 0.75rem;
  font-size: 0.875rem;
  line-height: 1.25rem;
}
.auth-screen .auth-form-card .auth-field .auth-field__input:not(.auth-field__input--theme-surface) {
  background-color: #fff;
}
.auth-field__input--theme-surface { color: #0a0a0a; }
.auth-field__input:focus-visible { border-color: #3b82f6; box-shadow: 0 0 0 1px #3b82f6; }
.auth-field__hint { margin: 0; color: #78716c; font-size: 0.75rem; line-height: 1rem; }
.auth-password-field { position: relative; }
.auth-password-field .auth-field__input { padding-right: 3rem; }
.auth-password-toggle {
  position: absolute;
  top: 50%;
  right: 0.75rem;
  display: flex;
  border: 0;
  padding: 0;
  color: #a8a29e;
  background: transparent;
  transform: translateY(-50%);
  transition: color 150ms ease;
}
.auth-password-toggle:hover { color: #57534e; }
.auth-password-toggle svg { width: 1.25rem; height: 1.25rem; }

.auth-phone-status,
.auth-phone-add {
  width: 100%;
  height: 3rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0 0.75rem;
  border-radius: 0.5rem;
}
.auth-phone-status { border: 1px solid #e7e5e4; color: #44403c; background: #f5f5f4; font-size: 0.875rem; }
.auth-phone-status svg { width: 1.25rem; height: 1.25rem; color: #16a34a; }
.auth-phone-status__verified { margin-left: auto; color: #16a34a; font-size: 0.75rem; }
.auth-phone-add { border: 1px solid #44403c; color: #a8a29e; background: #292524; transition: background-color 150ms ease; }
.auth-phone-add:hover { background: #44403c; }
.auth-phone-add svg { width: 1.25rem; height: 1.25rem; }

.auth-phone-modal[hidden],
.auth-phone-step[hidden],
.auth-phone-status[hidden] { display: none !important; }
.auth-phone-modal {
  position: fixed;
  z-index: 90;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  overflow-y: auto;
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(5px);
  -webkit-backdrop-filter: blur(5px);
}
.auth-phone-card {
  width: min(28rem, 100%);
  max-height: min(92vh, 46rem);
  padding: 1rem;
  overflow-y: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 1rem;
  color: #fff;
  background: linear-gradient(180deg, rgba(26, 26, 26, 0.98), rgba(13, 13, 13, 0.98));
  box-shadow: 0 1.5rem 4rem rgba(0, 0, 0, 0.55);
}
.auth-phone-card > header { display: flex; align-items: flex-start; justify-content: space-between; gap: 1rem; }
.auth-phone-card > header > div { min-width: 0; display: flex; align-items: center; gap: 0.65rem; }
.auth-phone-card > header > div > svg { width: 1.5rem; height: 1.5rem; flex: 0 0 auto; color: var(--ps-primary); }
.auth-phone-card > header h2 { margin: 0; color: #fff; font-family: Poppins, sans-serif; font-size: 1rem; }
.auth-phone-card > header p { margin: 0.1rem 0 0; color: #a3a3a3; font-size: 0.72rem; }
.auth-phone-card > header > button { width: 2rem; height: 2rem; padding: 0; display: grid; place-items: center; border: 0; border-radius: 50%; color: #a3a3a3; background: transparent; font-size: 1.5rem; line-height: 1; }
.auth-phone-card > header > button:hover { color: #fff; background: rgba(255, 255, 255, 0.08); }
.auth-phone-notice { margin: 0.85rem 0; padding: 0.65rem 0.75rem; border: 1px solid rgba(217, 119, 6, 0.45); border-radius: 0.6rem; color: #fde68a; background: rgba(120, 53, 15, 0.28); font-size: 0.72rem; }
.auth-phone-step { display: grid; gap: 0.85rem; }
.auth-phone-step > label { display: grid; gap: 0.35rem; color: #d4d4d4; font-size: 0.75rem; font-weight: 600; }
.auth-phone-step select,
.auth-phone-step input:not([type="checkbox"]) { min-height: 2.75rem; padding: 0.55rem 0.7rem; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.6rem; color: #fff; background: rgba(255, 255, 255, 0.08); }
.auth-phone-step select option { color: #111; background: #fff; }
.auth-phone-number-row { display: grid; grid-template-columns: auto 1fr; align-items: center; gap: 0.4rem; }
.auth-phone-number-row > span { min-width: 3rem; min-height: 2.75rem; display: grid; place-items: center; border: 1px solid rgba(255, 255, 255, 0.2); border-radius: 0.6rem; color: #d4d4d4; background: rgba(255, 255, 255, 0.06); }
.auth-phone-consent { display: flex !important; align-items: flex-start; gap: 0.5rem !important; color: #a3a3a3 !important; font-size: 0.68rem !important; font-weight: 400 !important; }
.auth-phone-consent input { width: 1rem; height: 1rem; flex: 0 0 auto; margin-top: 0.1rem; accent-color: var(--ps-primary); }
.auth-phone-primary { min-height: 2.8rem; display: flex; align-items: center; justify-content: center; border: 0; border-radius: 0.65rem; color: #fff; background: var(--ps-primary-dark, #15803d); font-weight: 700; }
.auth-phone-primary:hover { background: var(--ps-primary-hover, #16a34a); }
.auth-phone-primary:disabled { opacity: 0.55; }
.auth-phone-primary .auth-spinner { width: 1.25rem; height: 1.25rem; border-width: 2px; }
.auth-phone-step > p { margin: 0; color: #d4d4d4; font-size: 0.8rem; text-align: center; }
.auth-phone-otp { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 0.4rem; }
.auth-phone-otp input { width: 100%; min-width: 0; padding: 0.45rem 0 !important; font-size: 1.15rem; font-weight: 700; text-align: center; }
.auth-phone-resend,
.auth-phone-back { border: 0; padding: 0.25rem; color: var(--ps-primary); background: transparent; font-size: 0.75rem; }
.auth-phone-resend:disabled { color: #737373; }
.auth-phone-back { color: #a3a3a3; }

.auth-remember { display: flex; align-items: center; gap: 0.5rem; }
.auth-remember__checkbox { width: 1rem; height: 1rem; border-color: #d6d3d1; border-radius: 0.25rem; color: #16a34a; }
.auth-remember__label { color: #57534e; font-size: 0.875rem; line-height: 1.25rem; cursor: pointer; }

.auth-submit-button { padding: 1rem 0; font-size: clamp(1.2rem, 3vw, 1.6rem); }
.auth-submit-button:disabled { opacity: 0.5; }
.auth-forgot-button {
  width: 100%;
  padding: 0;
  border: 0;
  color: #15803d;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
}
.auth-forgot-button:hover { color: #166534; }

.auth-form__mode-switch {
  margin-top: 1.25rem;
  padding-top: 1.25rem;
  border-top: 1px solid #f5f5f4;
  text-align: center;
}
.auth-mode-button { border: 0; padding: 0; color: #78716c; background: transparent; font-size: 0.875rem; }
.auth-mode-button:hover { color: #44403c; }
.auth-mode-button__action { color: #16a34a; font-weight: 500; }

.auth-back-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.25rem;
  margin-right: auto;
  margin-left: auto;
  border: 0;
  padding: 0;
  color: rgba(255, 255, 255, 0.7);
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 1.25rem;
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.5);
}
.auth-back-button:hover { color: #fff; }
.auth-back-button svg { width: 1rem; height: 1rem; }
.auth-footer { padding-top: 0.25rem; text-align: center; }
.auth-footer__promise { margin: 0; color: rgba(255, 255, 255, 0.8); font-size: 0.75rem; font-weight: 500; line-height: 1rem; text-shadow: 0 2px 10px rgba(0,0,0,.5); }
.auth-footer__version { margin: 0.25rem 0 0; color: rgba(255, 255, 255, 0.5); font-size: 9px; letter-spacing: 0.15em; text-transform: uppercase; text-shadow: 0 2px 10px rgba(0,0,0,.5); }

/* Forgot-password overlay -------------------------------------------------- */

.forgot-password-modal {
  position: fixed;
  z-index: 50;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(0, 0, 0, 0.6);
}
.forgot-password-card { width: 100%; max-width: 28rem; animation: landing-fade-in 300ms ease forwards; }
.forgot-password-card__header { text-align: center; }
.forgot-password-card__icon {
  width: 4rem;
  height: 4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 1rem;
  border-radius: 50%;
  color: #15803d;
  background: #dcfce7;
}
.forgot-password-card__icon svg { width: 2rem; height: 2rem; }
.forgot-password-card__title { font-size: 1.25rem; line-height: 1.75rem; }
.forgot-password-form { display: block; }
.forgot-password-form > :not([hidden]) ~ :not([hidden]) { margin-top: 1rem; }
.forgot-password-success { display: flex; flex-direction: column; gap: 1rem; }
.forgot-password-copy { margin: 0 0 1rem; color: #57534e; font-size: 0.875rem; line-height: 1.25rem; text-align: center; }
.forgot-password-field { display: block; }
.forgot-password-field > :not([hidden]) ~ :not([hidden]) { margin-top: 0.5rem; }
.forgot-password-input { height: 3rem; padding: 0.25rem 0.75rem; font-size: 0.875rem; line-height: 1.25rem; }
.forgot-password-primary { width: 100%; background: #15803d; }
.forgot-password-primary:hover { background: #166534; }
.forgot-password-secondary { width: 100%; }
.forgot-password-success { text-align: center; }
.forgot-password-success p { margin: 0; color: #57534e; }
.forgot-password-success__hint { color: #78716c !important; font-size: 0.875rem; }

@media (min-width: 768px) {
  .pilot-screen__logo { width: 14rem; height: 14rem; }
  .pilot-screen__tagline { font-size: 1rem; }
}
