/* ============================================================================
   Pooleno Keycloak Theme — design tokens & components
   Hand-extracted from @pooleno/uikit-v3 (D:\dv3\src\global.css)
   ============================================================================ */

/* ---------- Fonts ---------- */
@font-face {
  font-family: "yekan-bakh";
  font-weight: 400;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/YekanBakhPooleno-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "yekan-bakh";
  font-weight: 600;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/YekanBakhPooleno-SemiBold.woff2") format("woff2");
}

@font-face {
  font-family: "yekan-bakh";
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  src: url("../fonts/YekanBakhPooleno-Bold.woff2") format("woff2");
}

/* ---------- Design tokens (light) ---------- */
:root {
  --radius: 0.5rem;
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-xl: 12px;
  --radius-2xl: 16px;
  --radius-3xl: 24px;
  --radius-4xl: 32px;

  /* Text */
  --placeholder-text: #959aa6;
  --light-text: #707580;
  --main-text: #2e3138;
  --dark-text: #1d1f24;

  /* Input */
  --input-background: #fbfbfb;
  --input-inactive-line: #dfe2eb;
  --input-active-line: #dfe2eb;
  --input-paper-border: #707580;

  /* Base surfaces. Page background is pure white (#fff) to match the
     customerDashboard body — guarantees banner images with baked-white
     backgrounds blend in seamlessly and transparent API banners sit on
     a clean canvas with no visible rectangle around them. */
  --base-background: #ffffff;
  --base-paper-border: #dfe2eb;
  --base-background-white: #ffffff;
  --base-border: #dfe2eb;
  --base-glassy-background: rgba(255, 255, 255, 0.4);
  --header-border: #e6e7f0;

  /* Brand (blue) */
  --brand-50: #f0f3fe;
  --brand-100: #dee5fd;
  --brand-200: #bccbfc;
  --brand-300: #97b2fa;
  --brand-400: #739bf8;
  --brand-500: #3b82f6;
  --brand-600: #2168cd;
  --brand-700: #164b99;
  --brand-800: #0c336b;
  --brand-900: #041c41;

  /* Status */
  --success-50: #cfffdf;
  --success-400: #15c16f;
  --success-500: #0fa961;
  --success-600: #09864c;
  --warning-50: #fff1ed;
  --warning-500: #f97315;
  --warning-600: #c65a0f;
  --error-50: #fef1f1;
  --error-500: #f55151;
  --error-600: #d32324;
  --info-50: #f0f3fe;
  --info-500: #3b82f6;
  --info-600: #2168cd;

  /* Greyscale */
  --grey-white: #ffffff;
  --grey-25: #fbfbfb;
  --grey-50: #f3f3f5;
  --grey-100: #edeff2;
  --grey-200: #dfe2eb;
  --grey-300: #bec2cc;
  --grey-400: #959aa6;
  --grey-500: #707580;
  --grey-600: #585c66;
  --grey-700: #454852;
  --grey-800: #2e3138;
  --grey-900: #1d1f24;
  --grey-black: #000000;

  --other-border: #ccd1e0;
  --base-font-family:
    "yekan-bakh", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;

  /* Typography sizes (from dv3) */
  --text-heading-lg: 28px;
  --text-heading-md: 24px;
  --text-heading-sm: 20px;
  --text-heading-xs: 18px;
  --text-title-lg: 16px;
  --text-title-md: 14px;
  --text-text-lg: 16px;
  --text-text-md: 14px;
  --text-text-sm: 12px;
  --text-caption-md: 12px;
  --text-caption-sm: 10px;
}

/* ============================================================================
   Reset / base
   ============================================================================ */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  margin: 0;
  padding: 0;
  font-family: var(--base-font-family);
  font-size: 14px;
  line-height: 1.5;
  background: var(--base-background);
  color: var(--main-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--base-background);
  color: var(--main-text);
  font-family: var(--base-font-family);
}

a {
  color: var(--brand-500);
  text-decoration: none;
}

a:hover {
  color: var(--brand-600);
}

img,
svg,
picture {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
}

p,
h1,
h2,
h3,
h4,
h5,
h6 {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* ============================================================================
   Layout — AuthLayout replica
   ============================================================================ */
.pl-auth-root {
  width: 100%;
  min-height: 100vh;
  position: relative;
  overflow-x: hidden;
  background: var(--base-background);
  padding-bottom: 200px;
  /* clear sticky footer on mobile */
}

@media (min-width: 800px) {
  .pl-auth-root {
    padding-bottom: 0;
  }
}

/* Header */
.pl-header {
  width: 100%;
  background: #ffffff;
  border-bottom: 1px solid var(--header-border);
  padding: 8px 12px;
}

.pl-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 40px;
  max-width: 1232px;
  margin: 0 auto;
}

.pl-header__logo {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  text-decoration: none;
}

.pl-header__logo img {
  height: 24px;
  width: auto;
}

/* Header CTA buttons */
.pl-btn--header-register {
  background: #1d1f24;
  border-color: #1d1f24;
  color: #ffffff;
}

.pl-btn--header-register:hover {
  background: #454852;
  border-color: #454852;
  color: #ffffff;
}

.pl-btn--header-download {
  background: transparent;
  border-color: #1d1f24;
  border: 1px solid !important;
  color: #1d1f24;
}

.pl-btn--header-download:hover {
  background: #dfe2eb;
  border-color: #1d1f24;
  color: #1d1f24;
}

.pl-header__actions--container {
  display: flex;
  align-items: center;
  gap: 24px;
}

.pl-goftino-trigger {
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  border: none;
  padding: 0;
  cursor: pointer;
  color: #1d1f24;
}

.pl-header__actions {
  display: none;
  gap: 16px;
  align-items: center;
}

@media (min-width: 800px) {
  .pl-header {
    padding: 16px;
  }

  .pl-header__inner {
    height: 40px;
  }

  .pl-header__logo img {
    height: 28px;
  }

  .pl-header__actions {
    display: inline-flex;
  }
}

/* Security notice — styled as a card matching the form surface */
.pl-security-notice-wrap {
  width: 100%;
  padding: 12px 16px 0;
  max-width: 846px;
  margin: 0 auto;
  box-sizing: border-box;
}

@media (min-width: 800px) {
  .pl-security-notice-wrap {
    padding: 16px 0 0;
  }
}

.pl-security-notice {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding: 10px 14px;
  color: var(--brand-500);
  flex-wrap: nowrap;
  border-radius: 12px;
}

.pl-security-notice__left {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
}

.pl-security-notice__left svg {
  width: 16px;
  height: 16px;
  color: var(--brand-500);
  flex-shrink: 0;
}

.pl-security-notice__right {
  color: var(--brand-500);
  direction: ltr;
  unicode-bidi: isolate;
  font-size: 10px;
}

@media (min-width: 800px) {
  .pl-security-notice__left,
  .pl-security-notice__right {
    font-size: 14px;
  }
}

@media (min-width: 800px) {
  .pl-security-notice {
    padding: 12px 16px;
    font-size: var(--text-text-md);
  }

  .pl-security-notice__left svg {
    width: 20px;
    height: 20px;
  }
}

/* Container */
.pl-container {
  max-width: 846px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
}

@media (min-width: 800px) {
  .pl-container {
    gap: 40px;
    margin-top: 24px;
    padding-bottom: 32px;
  }
}

.pl-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
}

@media (min-width: 800px) {
  .pl-grid {
    grid-template-columns: 1fr 1fr;
    gap: 0;
  }
}

/* Narrow column (forget password style) */
.pl-narrow {
  width: 100%;
  padding: 0 16px;
  margin-top: 40px;
}

@media (min-width: 800px) {
  .pl-narrow {
    max-width: 412px;
    margin: 24px auto 0;
    padding: 0;
  }
}

/* Banner side — visible on mobile and desktop, matching customerDashboard
   exactly. Container is fully transparent (no fill, no shadow, no border,
   no border-radius — nothing that could look like a frame around the image).
   The image fills the container via object-fit: cover, identical to the
   reference design's bannerContainer; any transparent regions inside the
   API-supplied image let the page background show through naturally. */
.pl-banner {
  position: relative;
  width: 100%;
  display: block;
  background: transparent;
  background-color: transparent;
  background-image: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  overflow: hidden;
}

@media (min-width: 800px) {
  .pl-banner {
    order: 2;
    align-self: start;
  }

  .pl-banner picture {
    transform: translateY(-127px);
    margin-bottom: -254px;
  }
}

.pl-banner picture {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.pl-banner img {
  display: block;
  width: 100%;
  height: auto;
  max-width: 100%;
  object-fit: contain;
  background: transparent;
  background-color: transparent;
  border: 0;
  box-shadow: none;
}

/* Form column */
.pl-form-col {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding: 0 16px 16px;
}

@media (min-width: 800px) {
  .pl-form-col {
    gap: 28px;
    padding: 0 16px 0;
    /* min-height: 500px; */
  }
}

.pl-form-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: flex-start;
}

@media (min-width: 800px) {
  .pl-form-header {
    gap: 12px;
  }
}

/* ============================================================================
   Typography helpers
   ============================================================================ */
.pl-heading {
  font-size: var(--text-heading-xs);
  font-weight: 700;
  line-height: 24px;
  color: var(--main-text);
}

@media (min-width: 800px) {
  .pl-heading {
    font-size: var(--text-heading-md);
    line-height: 40px;
  }
}

.pl-subtitle {
  font-size: var(--text-text-md);
  font-weight: 400;
  line-height: 24px;
  color: var(--light-text);
}

@media (min-width: 800px) {
  .pl-subtitle {
    font-size: var(--text-text-lg);
    line-height: 20px;
  }
}

.pl-text-strong {
  color: var(--main-text);
  font-weight: 600;
}

.pl-text-light {
  color: var(--light-text);
}

.pl-text-brand {
  color: var(--brand-500);
}

.pl-text-error {
  color: var(--error-500);
}

.pl-text-success {
  color: var(--success-500);
}

.pl-label {
  font-size: var(--text-title-md);
  font-weight: 600;
  line-height: 24px;
  color: var(--main-text);
}

@media (min-width: 800px) {
  .pl-label {
    font-size: var(--text-title-lg);
  }
}

.pl-phone-emph {
  font-weight: 600;
  color: var(--main-text);
  margin: 0 4px;
  direction: ltr;
  unicode-bidi: isolate;
  display: inline-block;
}

.h-full {
  height: 100%;
}

.justify-between {
  justify-content: space-between;
}

/* ============================================================================
   Form / Inputs
   ============================================================================ */
.pl-fields {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* .pl-fields--with-spacer {
  margin-bottom: 24px;
} */

/* @media (min-width: 800px) {
  .pl-fields--with-spacer {
    margin-bottom: 144px;
  }
} */

.pl-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Input wrapper. In RTL (Persian default), the FIRST DOM child renders on the
   visual RIGHT and the LAST child on the visual LEFT — that's the standard
   CSS flex behavior under direction:rtl. So all our templates put the main
   icon FIRST and the input SECOND, putting the icon on the right in RTL. */
.pl-input {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 40px;
  padding: 0 8px;
  border: 1px solid var(--base-border);
  border-radius: 12px;
  background: var(--base-background-white);
  color: var(--grey-800);
  font-size: var(--text-text-md);
  transition:
    border-color 0.15s ease,
    background-color 0.15s ease;
  box-sizing: border-box;
}

.pl-input:hover {
  border-color: var(--grey-600);
  background: var(--grey-25);
}

.pl-input:focus-within {
  border-color: var(--brand-500);
  background: var(--brand-50);
}

.pl-input--error,
.pl-input--error:focus-within {
  border-color: var(--error-500);
  background: var(--error-50);
}

.pl-input--disabled {
  background: var(--grey-25);
  border-color: var(--grey-100);
  color: var(--grey-300);
  cursor: not-allowed;
}

.pl-input input {
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
  border: none;
  background: transparent;
  outline: none;
  color: inherit;
  font-family: var(--base-font-family);
  font-size: var(--text-text-lg);
  font-weight: 400;
  line-height: 1.5;
  padding: 10px 0;
  /* Default text direction follows the html dir (RTL → right-aligned). */
  text-align: inherit;
}

.pl-input input::placeholder {
  color: var(--grey-400);
  opacity: 1;
  font-family: var(--base-font-family);
  font-weight: 400;
  font-size: var(--text-text-md);
}

.pl-input input::-webkit-input-placeholder {
  color: var(--grey-400);
  opacity: 1;
  font-family: var(--base-font-family);
  font-weight: 400;
}

.pl-input input::-moz-placeholder {
  color: var(--grey-400);
  opacity: 1;
  font-family: var(--base-font-family);
  font-weight: 400;
}

.pl-input input:-ms-input-placeholder {
  color: var(--grey-400);
  opacity: 1;
  font-family: var(--base-font-family);
  font-weight: 400;
}

.pl-input input:-webkit-autofill,
.pl-input input:-webkit-autofill:hover,
.pl-input input:-webkit-autofill:focus {
  -webkit-text-fill-color: var(--grey-800);
  -webkit-box-shadow: 0 0 0 1000px transparent inset;
  transition: background-color 999999s ease-in-out 0s;
}

/* Password/email inputs: keep LTR typing direction so Latin chars + cursor
   advance the natural way, but anchor placeholder + content to the RIGHT
   (the start side in the RTL page) so the Persian placeholder text reads
   from where the user expects it. */
.pl-input--ltr input {
  direction: ltr;
  text-align: right;
}

.pl-input--ltr input::placeholder {
  text-align: right;
  direction: rtl;
}

.pl-input__adorn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--grey-900);
  width: 20px;
  height: 20px;
}

.pl-input__adorn svg {
  width: 16px;
  height: 16px;
}

.pl-input__icon-btn {
  flex-shrink: 0;
  background: transparent;
  border: none;
  padding: 4px;
  cursor: pointer;
  color: var(--grey-500);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.pl-input__icon-btn:hover {
  color: var(--grey-700);
  background: var(--grey-50);
}

.pl-input__icon-btn svg {
  width: 20px;
  height: 20px;
}

.pl-field-error {
  display: block;
  font-size: var(--text-text-sm);
  color: var(--error-500);
  line-height: 20px;
  margin-top: 2px;
}

/* ============================================================================
   Button (mirrors dv3 Button)
   ============================================================================ */
.pl-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  white-space: nowrap;
  border: 1px solid transparent;
  border-radius: 9999px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition:
    background-color 0.15s ease,
    color 0.15s ease,
    border-color 0.15s ease;
  text-decoration: none;
  user-select: none;
  position: relative;
}

.pl-btn:focus-visible {
  outline: none;
  box-shadow: 0 0 0 4px var(--grey-200);
}

.pl-btn:disabled,
.pl-btn[aria-disabled="true"] {
  opacity: 0.5;
  cursor: not-allowed;
}

.pl-btn--24 {
  height: 24px;
  padding: 0 8px;
  font-size: var(--text-caption-md);
  gap: 4px;
}

.pl-btn--32 {
  height: 32px;
  padding: 0 12px;
  font-size: var(--text-caption-md);
}

.pl-btn--40 {
  height: 40px;
  padding: 0 16px;
  font-size: var(--text-title-md);
}

.pl-btn--48 {
  height: 48px;
  padding: 0 20px;
  font-size: var(--text-title-lg);
}

.pl-btn--block {
  width: 100%;
}

.pl-btn svg {
  flex-shrink: 0;
}

.pl-btn--40 svg,
.pl-btn--48 svg {
  width: 20px;
  height: 20px;
}

.pl-btn--24 svg,
.pl-btn--32 svg {
  width: 16px;
  height: 16px;
}

/* brand filled */
.pl-btn--brand {
  background: var(--brand-500);
  color: #ffffff;
  border-color: var(--brand-500);
}

.pl-btn--brand:hover {
  background: var(--brand-600);
  border-color: var(--brand-600);
  color: #ffffff;
}

/* brand secondary (light fill) */
.pl-btn--brand-secondary {
  background: var(--brand-50);
  color: var(--brand-500);
  border-color: transparent;
}

.pl-btn--brand-secondary:hover {
  background: var(--brand-100);
  color: var(--brand-600);
}

/* brand outline */
.pl-btn--brand-outline {
  background: transparent;
  color: var(--brand-500);
  border-color: var(--brand-500);
}

.pl-btn--brand-outline:hover {
  background: var(--brand-50);
  border-color: var(--brand-600);
  color: var(--brand-600);
}

/* text / link variant */
.pl-btn--text,
.pl-btn--link {
  background: transparent;
  border-color: transparent;
  color: var(--brand-500);
  padding: 0 6px;
}

.pl-btn--text:hover,
.pl-btn--link:hover {
  color: var(--brand-600);
  background: transparent;
}

/* default (grey) */
.pl-btn--default {
  background: var(--grey-900);
  color: var(--grey-25);
  border-color: var(--grey-900);
}

.pl-btn--default:hover {
  background: var(--grey-600);
  border-color: var(--grey-600);
}

.pl-btn--fit {
  width: fit-content;
}

.pl-btn--end {
  margin-inline-start: auto;
}

/* spinner inside button */
.pl-btn__spin {
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: pl-spin 0.8s linear infinite;
}

.pl-btn[data-loading="true"] .pl-btn__label {
  visibility: hidden;
}

.pl-btn[data-loading="true"]::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  margin-top: -9px;
  margin-left: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 2px solid currentColor;
  border-top-color: transparent;
  animation: pl-spin 0.8s linear infinite;
}

/* ============================================================================
   Spinner standalone
   ============================================================================ */
.pl-spinner {
  display: inline-block;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid var(--grey-200);
  border-top-color: var(--brand-500);
  animation: pl-spin 0.8s linear infinite;
}

@keyframes pl-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ============================================================================
   Divider
   ============================================================================ */
.pl-divider {
  width: 100%;
  height: 1px;
  background: var(--base-paper-border);
  border: 0;
  margin: 0;
}

/* ============================================================================
   Alert
   ============================================================================ */
.pl-alert {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border-radius: 8px;
  background: var(--base-background-white);
}

.pl-alert__row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.pl-alert__icon {
  min-width: 20px;
  min-height: 20px;
  flex-shrink: 0;
}

.pl-alert__content {
  font-size: var(--text-text-sm);
  line-height: 20px;
  color: var(--dark-text);
  word-break: break-word;
}

.pl-alert--info {
  background: var(--brand-50);
}

.pl-alert--info .pl-alert__icon {
  color: var(--brand-600);
}

.pl-alert--success {
  background: var(--success-50);
}

.pl-alert--success .pl-alert__icon {
  color: var(--success-500);
}

.pl-alert--warning {
  background: var(--warning-50);
}

.pl-alert--warning .pl-alert__icon {
  color: var(--warning-500);
}

.pl-alert--error {
  background: var(--error-50);
}

.pl-alert--error .pl-alert__icon {
  color: var(--error-500);
}

/* ============================================================================
   Sticky footer (mobile fixed, desktop absolute)
   ============================================================================ */
.pl-footer-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
  background: var(--base-glassy-background);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 10;
}

@media (min-width: 800px) {
  .pl-footer-actions {
    position: static;
    padding: 0 0;
    background: transparent;
    backdrop-filter: none;
  }
}

.pl-footer-cta-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--text-text-md);
  flex-wrap: wrap;
}

/* ============================================================================
   Checkbox
   ============================================================================ */
.pl-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  user-select: none;
  font-size: var(--text-text-md);
  color: var(--grey-800);
  position: relative;
}

.pl-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  pointer-events: none;
  width: 0;
  height: 0;
}

.pl-checkbox__box {
  width: 20px;
  height: 20px;
  border-radius: 4px;
  border: 1.5px solid var(--grey-400);
  background: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.pl-checkbox input:checked+.pl-checkbox__box {
  background: var(--grey-800);
  border-color: var(--grey-800);
}

.pl-checkbox input:checked+.pl-checkbox__box::after {
  content: "";
  width: 12px;
  height: 12px;
  background: no-repeat center / contain url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>");
}

.pl-checkbox:hover .pl-checkbox__box {
  border-color: var(--grey-600);
}

.pl-checkbox input:focus-visible+.pl-checkbox__box {
  box-shadow: 0 0 0 3px var(--brand-100);
}

/* ============================================================================
   OTP Input boxes
   ============================================================================ */
.pl-otp {
  display: flex;
  flex-direction: row;
  gap: 8px;
  width: 100%;
  justify-content: space-between;
  direction: ltr;
}

.pl-otp__box {
  flex: 1 1 0;
  min-width: 0;
  width: 48px;
  height: 48px;
  text-align: center;
  border: 1px solid #dee2e3;
  border-radius: 12px;
  font-size: 20px;
  font-weight: 600;
  color: var(--main-text);
  background: var(--base-background-white);
  outline: none;
  transition:
    border-color 0.15s ease,
    box-shadow 0.15s ease;
  font-family: inherit;
}

.pl-otp__box::placeholder {
  color: var(--grey-300);
}

.pl-otp__box:focus {
  border-color: #717576;
  box-shadow: 0 0 0 1px #717576;
}

.pl-otp__box.pl-otp__box--error,
.pl-otp__box.pl-otp__box--error:focus {
  border-color: var(--error-500);
  box-shadow: 0 0 0 1px var(--error-500);
}

@media (min-width: 1024px) {
  .pl-otp__box {
    width: 56px;
    height: 56px;
    font-size: 22px;
  }
}

.pl-otp-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  font-size: var(--text-text-sm);
  color: var(--grey-500);
  margin-top: 8px;
  gap: 8px;
  flex-wrap: wrap;
}

/* ============================================================================
   PasswordGuide list
   ============================================================================ */
.pl-pwd-guide {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pl-pwd-rule {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--text-text-sm);
  color: var(--light-text);
  line-height: 20px;
}

.pl-pwd-rule__icon {
  width: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--grey-400);
}

.pl-pwd-rule--met .pl-pwd-rule__icon {
  color: var(--success-500);
}

/* ============================================================================
   Referral (collapsible optional field) — mirrors customerDashboard's
   phone-step referral component:
     <toggle text>  <chevron-down ↕>
     [collapsible input panel]
   The collapse animation runs on max-height (managed by JS), the chevron
   rotates via CSS transition.
   ============================================================================ */
.pl-referral {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pl-referral__toggle {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: transparent;
  border: 0;
  padding: 4px 0;
  cursor: pointer;
  color: var(--main-text);
  font-family: var(--base-font-family);
  font-size: var(--text-text-sm);
  font-weight: 400;
  line-height: 20px;
  width: fit-content;
  text-align: start;
}

.pl-referral__toggle:hover {
  color: var(--brand-500);
}

.pl-referral__toggle:hover .pl-referral__arrow {
  color: var(--brand-500);
}

.pl-referral__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 16px;
  height: 16px;
  color: var(--grey-900);
  transform: rotate(0deg);
  transition: transform 0.3s ease;
}

.pl-referral__arrow svg {
  width: 16px;
  height: 16px;
}

.pl-referral__content {
  overflow: hidden;
  max-height: 0;
  transition: max-height 0.2s ease;
}

.pl-referral__content>* {
  /* breathing room only when open, avoids 0-height bleed */
  padding-top: 2px;
}

/* ============================================================================
   Back button row
   ============================================================================ */
.pl-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: transparent;
  border: none;
  color: var(--brand-500);
  font-weight: 600;
  cursor: pointer;
  padding: 2px 0;
  font-size: var(--text-caption-md);
  text-decoration: none;
}

.pl-back:hover {
  color: var(--brand-600);
}

.pl-back svg {
  width: 16px;
  height: 16px;
}

/* In RTL, arrow points right visually; we use ArrowRight icon */

/* ============================================================================
   Success card (final step)
   ============================================================================ */
.pl-success-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
  padding: 24px;
  max-width: 384px;
  margin: 40px auto;
  background: var(--base-background-white);
  border-radius: 16px;
  border: 1px solid var(--base-border);
}

.pl-success-card__icon {
  width: 56px;
  height: 56px;
  color: var(--success-400);
}

@media (min-width: 640px) {
  .pl-success-card__icon {
    width: 64px;
    height: 64px;
  }
}

.pl-success-card__title {
  font-size: var(--text-title-lg);
  font-weight: 600;
  line-height: 24px;
  color: var(--main-text);
}

.pl-success-card__body {
  font-size: var(--text-text-md);
  line-height: 24px;
  color: var(--light-text);
  max-width: 320px;
}

/* ============================================================================
   Util
   ============================================================================ */
.pl-stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.pl-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.pl-stack-lg {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.pl-row {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.pl-row-between {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  width: 100%;
}

.pl-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Avoid sticky footer overlap on long forms */
.pl-bottom-spacer-mobile {
  height: 140px;
}

@media (min-width: 800px) {
  .pl-bottom-spacer-mobile {
    display: none;
  }
}

/* Keycloak v2 internal hooks we don't use but keep no-op */
#kc-form-buttons-wrapper {
  margin-top: 16px;
}

/* Hide banner on mobile when keyboard is open (any input focused).
   Prevents the banner from pushing the focused input under the soft keyboard.
   Desktop (≥800px) is unaffected. */
@media (max-width: 799px) {
  .pl-grid:focus-within .pl-banner {
    display: none;
  }
}