/* /user/login/ – one card: email code, "or", Continue with Google; support panel after two misses.
   Brand: P4L red #e50019, ink #08141d, Inter, pill buttons (css_v2/style.css). */
.p4l-login {
  --p4l-red: #e50019;
  --p4l-red-dark: #b80014;
  --p4l-ink: #08141d;
  --p4l-text: #2b3640;
  --p4l-muted: #6c757d;
  --p4l-line: #d9dde1;
  --p4l-soft: #f5f6f8;
  --p4l-error: #c4001a;
  --p4l-error-bg: #fdecee;
  --p4l-ok-bg: #eef7f0;
  --p4l-ok: #2f6b3e;
  --p4l-radius: 14px;
  --p4l-focus: 0 0 0 3px rgba(229, 0, 25, .22);
  --p4l-whatsapp: #25d366;
  --p4l-whatsapp-dark: #128c4b;
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--p4l-text);
  background:
    radial-gradient(900px 420px at 50% -120px, rgba(229, 0, 25, .07), transparent 70%),
    linear-gradient(180deg, #fff 0%, #fbf4f5 100%);
  padding: 56px 16px 72px;
}

.p4l-login *, .p4l-login *::before, .p4l-login *::after { box-sizing: border-box; }

.p4l-login__card {
  max-width: 440px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(8, 20, 29, .05);
  border-radius: 24px;
  box-shadow: 0 18px 48px rgba(8, 20, 29, .09), 0 2px 6px rgba(8, 20, 29, .04);
  padding: 36px 36px 32px;
  animation: p4l-rise .4s cubic-bezier(.2, .7, .2, 1);
}
@keyframes p4l-rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.p4l-login__head { text-align: center; margin-bottom: 26px; }
.p4l-login__badge {
  display: inline-grid;
  place-items: center;
  width: 56px;
  height: 56px;
  margin-bottom: 14px;
  border-radius: 18px;
  background: linear-gradient(145deg, #ff2d42, var(--p4l-red) 55%, var(--p4l-red-dark));
  box-shadow: 0 10px 22px rgba(229, 0, 25, .25);
}
.p4l-login__badge svg { width: 28px; height: 28px; fill: none; stroke: #fff; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p4l-login__title { font-size: 28px; font-weight: 700; color: var(--p4l-ink); margin: 0 0 6px; }
.p4l-login__subtitle { font-size: 15px; color: var(--p4l-muted); margin: 0; }

/* ---- steps ---- */
.p4l-step, .p4l-help, .p4l-alt { animation: p4l-fade .28s ease; }
.p4l-step[hidden], .p4l-help[hidden], .p4l-alt[hidden], .p4l-login__main[hidden] { display: none; }
@keyframes p4l-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.p4l-step__lead { font-size: 14.5px; color: var(--p4l-muted); margin: 0 0 14px; text-align: center; }
.p4l-step__lead strong { display: block; margin-top: 2px; color: var(--p4l-ink); overflow-wrap: anywhere; }

/* ---- fields ---- */
.p4l-field { margin-bottom: 18px; }
.p4l-field label { display: block; font-size: 14px; font-weight: 600; color: var(--p4l-ink); margin-bottom: 7px; }
.p4l-field input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 16px;
  border: 1.5px solid var(--p4l-line);
  border-radius: var(--p4l-radius);
  background: #fff;
  color: var(--p4l-ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming on focus */
  transition: border-color .2s ease, box-shadow .2s ease;
}
.p4l-field input:focus { outline: none; border-color: var(--p4l-red); box-shadow: var(--p4l-focus); }
.p4l-field input[aria-invalid="true"] { border-color: var(--p4l-error); }
.p4l-field__error { color: var(--p4l-error); font-size: 13px; margin: 6px 2px 0; }
.p4l-field__hint { color: var(--p4l-muted); font-size: 13px; margin: 7px 2px 0; }
.p4l-input:has(input[aria-invalid="true"]) ~ .p4l-field__hint { display: none; }

.p4l-input { position: relative; }
.p4l-input__icon {
  position: absolute; top: 50%; left: 16px; transform: translateY(-50%);
  width: 20px; height: 20px; fill: none; stroke: var(--p4l-muted); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round; pointer-events: none; transition: stroke .2s ease;
}
.p4l-field .p4l-input input { padding-left: 46px; }
.p4l-input:focus-within .p4l-input__icon { stroke: var(--p4l-red); }
[dir="rtl"] .p4l-input__icon { left: auto; right: 16px; }
[dir="rtl"] .p4l-field .p4l-input input { padding-left: 16px; padding-right: 46px; }
.p4l-field__error[hidden] { display: none; }

/* ---- buttons ---- */
.p4l-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 50px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .02em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background .25s ease, border-color .25s ease, transform .1s ease, box-shadow .25s ease;
}
.p4l-btn--primary { background: var(--p4l-red); border-color: var(--p4l-red); color: #fff; box-shadow: 0 6px 16px rgba(229, 0, 25, .22); }
.p4l-btn--primary:hover { background: var(--p4l-ink); border-color: var(--p4l-ink); box-shadow: none; }
.p4l-btn:active { transform: scale(.99); }
.p4l-btn:focus-visible { outline: none; box-shadow: var(--p4l-focus); }
.p4l-btn[disabled] { opacity: .65; cursor: not-allowed; }
.p4l-btn__spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2.5px solid rgba(255, 255, 255, .45);
  border-top-color: #fff;
  border-radius: 50%;
  animation: p4l-spin .75s linear infinite;
}
.p4l-btn.is-loading .p4l-btn__spinner { display: inline-block; }
@keyframes p4l-spin { to { transform: rotate(360deg); } }

.p4l-link { color: var(--p4l-red); font-size: 13.5px; font-weight: 600; text-decoration: none; }
.p4l-link:hover { color: var(--p4l-red-dark); text-decoration: underline; }
.p4l-link--button { background: none; border: 0; padding: 2px; font: inherit; font-size: 13.5px; font-weight: 600; color: var(--p4l-red); cursor: pointer; }
.p4l-link--button[disabled] { color: var(--p4l-muted); cursor: default; text-decoration: none; }
.p4l-link--button:focus-visible, .p4l-link:focus-visible { outline: none; box-shadow: var(--p4l-focus); border-radius: 4px; }
.p4l-change { display: block; margin: -6px auto 16px; }

/* ---- alerts ---- */
.p4l-alert {
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 14px;
  line-height: 1.45;
  margin-bottom: 18px;
  background: var(--p4l-error-bg);
  color: var(--p4l-error);
  border: 1px solid rgba(196, 0, 26, .18);
}
.p4l-alert[hidden] { display: none; }
.p4l-alert--success { background: var(--p4l-ok-bg); color: var(--p4l-ok); border-color: rgba(47, 107, 62, .2); }
.p4l-note { background: #fff7e6; color: #7a5200; border: 1px solid #f3dca4; border-radius: 12px; padding: 12px 14px; font-size: 14px; line-height: 1.45; margin-bottom: 18px; }

/* ---- OTP boxes ---- */
.p4l-otp { display: flex; justify-content: center; gap: 10px; direction: ltr; }
.p4l-otp[hidden] { display: none; }
.p4l-field .p4l-otp__box {
  width: 50px;
  height: 58px;
  padding: 0;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  border-radius: 12px;
}
.p4l-otp__fallback { text-align: center; letter-spacing: 8px; font-size: 22px; }
.p4l-otp__fallback.is-hidden { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.p4l-timer { text-align: center; font-size: 13.5px; color: var(--p4l-muted); margin: -4px 0 16px; font-variant-numeric: tabular-nums; }
.p4l-timer.is-expired { color: var(--p4l-error); }
.p4l-resend { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 4px; margin-top: 14px; font-size: 13.5px; color: var(--p4l-muted); font-variant-numeric: tabular-nums; }

/* ---- or ---- */
.p4l-divider {
  display: flex; align-items: center; gap: 14px; margin: 24px 0 18px;
  color: var(--p4l-muted); font-size: 12.5px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase;
}
.p4l-divider::before, .p4l-divider::after { content: ""; flex: 1; height: 1px; background: var(--p4l-line); }

/* ---- social ---- */
.p4l-social-form { margin: 0; }
.p4l-social {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  min-height: 50px;
  padding: 0 20px;
  border-radius: 999px;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s ease, box-shadow .2s ease;
}
.p4l-social__logo { width: 20px; height: 20px; flex: none; }
.p4l-social--google { background: #fff; color: #1f1f1f; border: 1.5px solid #dadce0; }
.p4l-social--google:hover { background: #f8f9fa; box-shadow: 0 1px 3px rgba(60, 64, 67, .25); }
.p4l-social:focus-visible { outline: none; box-shadow: var(--p4l-focus); }
.p4l-social.is-loading { opacity: .7; pointer-events: none; }

/* ---- help panel ---- */
.p4l-help { text-align: center; }
.p4l-help:focus { outline: none; }
.p4l-help__icon {
  display: inline-grid; place-items: center; width: 64px; height: 64px; margin-bottom: 14px;
  border-radius: 50%; background: var(--p4l-error-bg); box-shadow: 0 0 0 8px rgba(229, 0, 25, .04);
}
.p4l-help__icon svg { width: 30px; height: 30px; fill: none; stroke: var(--p4l-red); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.p4l-help__title { font-size: 20px; font-weight: 700; color: var(--p4l-ink); margin: 0 0 8px; }
.p4l-help__text { font-size: 14.5px; line-height: 1.6; color: var(--p4l-text); margin: 0 0 22px; }
.p4l-help__options { display: grid; gap: 12px; text-align: start; }
.p4l-help__retry { margin-top: 20px; }

.p4l-contact {
  display: flex; align-items: center; gap: 14px; padding: 14px 16px;
  border: 1.5px solid var(--p4l-line); border-radius: 16px; background: #fff;
  color: var(--p4l-ink); text-decoration: none;
  transition: border-color .2s ease, box-shadow .2s ease, transform .15s ease;
}
.p4l-contact:hover { text-decoration: none; color: var(--p4l-ink); transform: translateY(-1px); box-shadow: 0 8px 20px rgba(8, 20, 29, .08); }
.p4l-contact:focus-visible { outline: none; box-shadow: var(--p4l-focus); }
.p4l-contact__icon { display: grid; place-items: center; flex: none; width: 46px; height: 46px; border-radius: 14px; }
.p4l-contact__icon svg { width: 24px; height: 24px; }
.p4l-contact__body { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.p4l-contact__label { font-size: 15px; font-weight: 700; }
.p4l-contact__value { font-size: 13.5px; color: var(--p4l-muted); overflow-wrap: anywhere; text-align: start; }
.p4l-contact__arrow { flex: none; width: 20px; height: 20px; fill: none; stroke: var(--p4l-muted); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
[dir="rtl"] .p4l-contact__arrow { transform: scaleX(-1); }

.p4l-contact--whatsapp:hover { border-color: var(--p4l-whatsapp); }
.p4l-contact--whatsapp .p4l-contact__icon { background: var(--p4l-whatsapp); }
.p4l-contact--whatsapp .p4l-contact__icon svg { fill: #fff; }
.p4l-contact--whatsapp:hover .p4l-contact__arrow { stroke: var(--p4l-whatsapp-dark); }
.p4l-contact--email:hover { border-color: var(--p4l-red); }
.p4l-contact--email .p4l-contact__icon { background: var(--p4l-error-bg); }
.p4l-contact--email .p4l-contact__icon svg { fill: none; stroke: var(--p4l-red); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.p4l-contact--email:hover .p4l-contact__arrow { stroke: var(--p4l-red); }

.p4l-visually-hidden { position: absolute !important; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---- responsive ---- */
@media (max-width: 575.98px) {
  .p4l-login { padding: 24px 16px 40px; }
  .p4l-login__card { padding: 26px 18px 20px; border-radius: 20px; }
  .p4l-login__title { font-size: 24px; }
  .p4l-field .p4l-otp__box { width: 42px; height: 52px; font-size: 21px; }
  .p4l-otp { gap: 7px; }
}
@media (max-width: 359.98px) {
  .p4l-field .p4l-otp__box { width: 36px; height: 48px; }
  .p4l-otp { gap: 5px; }
}
@media (prefers-reduced-motion: reduce) {
  .p4l-login__card, .p4l-step, .p4l-help, .p4l-alt, .p4l-contact, .p4l-btn__spinner { animation: none; transition: none; }
}
