/* People's Pay — exact reference layout */

:root {
  --red: #e02020;
  --red-press: #c41a1a;
  --navy: #1a3a5c;
  --navy-bold: #1a2d4a;
  --text-muted: #9aa3b2;
  --input-bg: #f0f4f8;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  height: 100%;
  -webkit-text-size-adjust: 100%;
}

body {
  height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  background: #fff;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

.pp-app {
  width: 100%;
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 auto;
  background: #fff;
  position: relative;
  overflow: hidden;
}

.screen {
  display: none;
  position: absolute;
  inset: 0;
  flex-direction: column;
  overflow: hidden;
}

.screen.active {
  display: flex;
}

/* Header: hero + curve */
.pp-header {
  position: relative;
  flex-shrink: 0;
  z-index: 1;
}

.pp-hero-img {
  height: 42dvh;
  min-height: 240px;
  max-height: 340px;
  background: url('__PP_BACKGROUND__') center top / cover no-repeat;
}

.pp-curve {
  display: block;
  width: 100%;
  height: 90px;
  margin-top: -89px;
  position: relative;
  z-index: 2;
  pointer-events: none;
}

.pp-back {
  position: absolute;
  top: calc(env(safe-area-inset-top, 0px) + 10px);
  left: 16px;
  z-index: 5;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  color: #333;
  display: grid;
  place-items: center;
  cursor: pointer;
  padding: 0;
}

.pp-back svg {
  width: 20px;
  height: 20px;
}

/* White body below curve */
.pp-body {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  background: #fff;
  padding: 0 22px calc(env(safe-area-inset-bottom, 0px) + 8px);
  overflow: hidden;
}

.pp-body--otp {
  overflow-y: auto;
}

.pp-brand {
  text-align: center;
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.02em;
  margin-bottom: 16px;
}

.pp-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  flex-shrink: 0;
}

.pp-input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid #e2e8f0;
  border-radius: 12px;
  font-size: 0.9375rem;
  font-family: inherit;
  color: #1a1a1a;
  background: var(--input-bg);
  outline: none;
}

.pp-input::placeholder {
  color: #b0b8c4;
}

.pp-input:focus {
  border-color: #cbd5e1;
}

.pp-input:-webkit-autofill,
.pp-input:-webkit-autofill:hover,
.pp-input:-webkit-autofill:focus {
  -webkit-box-shadow: 0 0 0 1000px var(--input-bg) inset;
  box-shadow: 0 0 0 1000px var(--input-bg) inset;
  -webkit-text-fill-color: #1a1a1a;
  transition: background-color 99999s ease-out 0s;
}

.pp-input.input-error {
  border-color: #fca5a5;
  background: #fef2f2;
}

.pp-pass-wrap {
  position: relative;
}

.pp-pass-wrap .pp-input {
  padding-right: 44px;
}

.pp-eye {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 30px;
  height: 30px;
  border: none;
  background: none;
  color: #a0aec0;
  cursor: pointer;
  display: grid;
  place-items: center;
  padding: 0;
}

.pp-eye svg {
  width: 22px;
  height: 22px;
}

.pp-eye-on[hidden],
.pp-eye-off[hidden] {
  display: none !important;
}

.pp-qr {
  display: inline-flex;
  align-items: center;
  align-self: center;
  gap: 6px;
  border: none;
  background: none;
  color: var(--text-muted);
  font-family: inherit;
  font-size: 0.8rem;
  font-weight: 500;
  cursor: pointer;
  padding: 0;
  width: auto;
}

.pp-qr svg {
  width: 18px;
  height: 18px;
  color: var(--red);
  flex-shrink: 0;
}

.pp-forgot {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
}

.pp-link {
  border: none;
  background: none;
  font-family: inherit;
  font-size: inherit;
  font-weight: 700;
  color: var(--navy-bold);
  cursor: pointer;
  padding: 0;
}

.pp-btn-login {
  width: 100%;
  padding: 15px;
  border: none;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  font-family: inherit;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 6px;
}

.pp-btn-login:active {
  background: var(--red-press);
}

.pp-btn-login:disabled {
  opacity: 0.6;
}

.pp-bottom {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 0;
  padding-top: 10px;
}

.pp-actions {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}

.pp-actions::-webkit-scrollbar {
  display: none;
}

.pp-action {
  flex: 0 0 auto;
  width: 76px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 12px 6px 10px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.07);
  font-size: 0.6rem;
  font-weight: 600;
  color: #6b7280;
  text-align: center;
  line-height: 1.2;
}

.pp-action-ico {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.15rem;
  font-weight: 700;
  line-height: 1;
}

.pp-action-ico svg {
  width: 22px;
  height: 22px;
}

.pp-action-ico--green { background: #e8f5e9; color: #22a04a; }
.pp-action-ico--teal { background: #dff7f2; color: #0d9488; }
.pp-action-ico--orange { background: #fff3e0; color: #f97316; }
.pp-action-ico--blue { background: #e8f0fe; color: #3b82f6; }
.pp-action-ico--yellow { background: #fef9c3; color: #ca8a04; }

.pp-ver {
  text-align: center;
  font-size: 0.65rem;
  color: #d1d5db;
  margin-top: 10px;
  padding-bottom: 2px;
}

/* OTP */
.pp-otp-title {
  text-align: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--navy);
  margin-bottom: 8px;
}

.pp-otp-sub {
  text-align: center;
  font-size: 0.8rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 14px;
}

.pp-otp-phone,
.pp-otp-email {
  text-align: center;
  font-size: 0.9rem;
  color: #374151;
  line-height: 1.6;
}

.pp-otp-row {
  display: flex;
  justify-content: center;
  gap: 8px;
  margin: 24px 0;
}

.pp-otp-cell {
  width: 42px;
  height: 48px;
  border: 1px solid #dce3ec;
  border-radius: 8px;
  text-align: center;
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--navy);
  background: #fff;
  outline: none;
}

.pp-otp-cell:focus {
  border-color: #4a6fa5;
}

.pp-otp-resend {
  text-align: center;
  font-size: 0.875rem;
  color: var(--text-muted);
  margin-bottom: 18px;
}

.pp-otp-resend span {
  color: var(--red);
  font-weight: 700;
}

.pp-stripe-bar {
  display: flex;
  height: 5px;
  flex-shrink: 0;
}

.pp-stripe-bar span:nth-child(1) { flex: 1; background: #e02020; }
.pp-stripe-bar span:nth-child(2) { flex: 1; background: #f59e0b; }
.pp-stripe-bar span:nth-child(3) { flex: 1; background: #22c55e; }

.form-error {
  color: #dc2626;
  font-size: 0.75rem;
  margin-top: -4px;
}

.user-toast {
  position: fixed;
  left: 50%;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 20px);
  transform: translateX(-50%) translateY(120%);
  background: rgba(17, 24, 39, 0.92);
  color: #fff;
  padding: 12px 18px;
  border-radius: 12px;
  font-size: 0.85rem;
  z-index: 9999;
  transition: transform 0.25s;
  max-width: calc(100% - 32px);
  text-align: center;
}

.user-toast.show {
  transform: translateX(-50%) translateY(0);
}

.user-toast.error {
  background: rgba(224, 32, 32, 0.95);
}

.pp-home-bar {
  position: absolute;
  bottom: calc(env(safe-area-inset-bottom, 0px) + 5px);
  left: 50%;
  transform: translateX(-50%);
  width: 120px;
  height: 4px;
  border-radius: 999px;
  background: #1a1a1a;
  z-index: 10;
  pointer-events: none;
}
