/* public/css/auth.css
   ---------------------------------------------------------------------------
   Split sign-in shell: form on the left, marketing panel on the right.
   Loaded only by layouts/guest.blade.php, so nothing here can reach the app.

   Every colour, radius and font comes from root.css tokens. Fonts are set
   explicitly on input/button/select because those elements do NOT inherit the
   page family — that is the usual way a control drifts to a system font.
   Buttons change colour on hover and never move or resize. */

/* ---------------------------------------------------------------- shell -- */

.pf-auth {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: var(--color-gray-060);
  font-family: var(--font-body);
  color: var(--color-text);
}

.pf-auth__grid {
  width: 100%;
  max-width: 1180px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 28px;
  align-items: stretch;
}

/* ------------------------------------------------------------ left card -- */

.pf-auth__panel {
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  box-shadow: var(--shadow2);
  padding: 44px 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 560px;
}

.pf-auth__brand {
  display: block;
  margin-bottom: 44px;
}

.pf-auth__brand img {
  height: 68px;
  width: auto;
  object-fit: contain;
}

.pf-auth__title {
  font-family: var(--font-heading);
  font-size: 2rem;
  line-height: 1.2;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 8px;
}

.pf-auth__sub {
  font-family: var(--font-body);
  font-size: .95rem;
  color: var(--color-gray-600);
  margin: 0 0 28px;
}

/* ---------------------------------------------------------------- form -- */

.pf-field {
  margin-bottom: 18px;
}

.pf-label {
  display: block;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 7px;
}

.pf-input {
  width: 100%;
  box-sizing: border-box;
  padding: 13px 14px;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-white);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .95rem;
  outline: none;
  transition: border-color .2s ease, box-shadow .2s ease;
}

.pf-input::placeholder {
  color: var(--color-gray-350);
}

.pf-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--alpha-accent-20, rgba(25, 130, 196, .16));
}

/* Fixed country code. Nepal-only for now, so it is displayed, not chosen —
   a select here would only ever hold one option. */
.pf-phone {
  display: flex;
  align-items: stretch;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-white);
  /* NOT overflow:hidden — that would clip the focus glow on the digit blocks,
     which sit inside this box. The blocks carry their own rounded corners. */
  transition: border-color .2s ease, box-shadow .2s ease;
}

/* The digit blocks carry their own focus state, so the group only needs a
   quiet border change — a second glow here would fight theirs. */
.pf-phone:focus-within {
  border-color: var(--color-gray-300);
}

.pf-phone__cc {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 0 12px;
  border-right: 1px solid var(--color-gray-200);
  border-radius: 9px 0 0 9px;
  background: var(--color-gray-060);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 600;
  white-space: nowrap;
  user-select: none;
  flex: 0 0 auto;
}

/* Drawn flag, not the 🇳🇵 emoji — Windows ships no country-flag glyphs, so the
   emoji renders there as the letters "NP". An SVG looks the same everywhere. */
.pf-phone__flag {
  display: block;
  flex: 0 0 auto;
  width: 14px;
  height: auto;
}

/* Ten single-digit blocks. They flex down rather than wrap, so ten of them plus
   the +977 prefix still fit a 375px screen without overflowing.
   Tight gaps: the ten blocks should read as one field, not ten controls. */
.pf-digits {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
  padding: 5px 7px;
}

.pf-digit {
  flex: 1 1 0;
  min-width: 0;
  width: 100%;
  height: 38px;
  box-sizing: border-box;
  padding: 0;
  /* Very faint outline — present enough to separate the blocks, quiet enough
     that ten of them in a row do not look like a grid of boxes. */
  border: 1px solid #EDF0F4;
  border-radius: 8px;
  background: #FBFCFD;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 600;
  text-align: center;
  outline: none;
  caret-color: var(--accent);
  transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.pf-digit:hover {
  border-color: #E2E7EE;
}

/* Once the user starts typing, the blocks lift from recessed to solid. */
.pf-phone.is-filling .pf-digit,
.pf-phone.is-complete .pf-digit {
  background: var(--color-white);
}

.pf-digit::-webkit-outer-spin-button,
.pf-digit::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Never paint the browser's blue selection over a digit — with one character
   per block there is nothing useful to select, and it reads as a defect. */
.pf-digit::selection {
  background: transparent;
  color: inherit;
}

/* The block being typed into. Amber, but restrained. */
.pf-digit:focus {
  border-color: #E3A81A;
  background: var(--color-white);
  box-shadow: 0 0 0 3px rgba(227, 168, 26, .18);
}

/* All ten in. A soft green edge on the blocks only — no second ring on the
   container, which made the field look alarmed rather than confirmed. */
.pf-phone.is-complete .pf-digit {
  border-color: #9FD9B4;
  background: #FAFEFB;
}

.pf-phone.is-complete .pf-digit:focus {
  border-color: #38A169;
  box-shadow: 0 0 0 3px rgba(56, 161, 105, .18);
}

.pf-phone.is-complete {
  border-color: #C6E7D3;
}

/* While a partial number is being entered, keep the container quiet. */
.pf-phone.is-filling {
  border-color: var(--color-gray-300);
}

/* Ten blocks across a 375px screen cannot each be 44px wide — that is inherent
   to the layout. Give back what can be given: a narrower country-code prefix,
   tighter gaps, and a taller block, so the touch target is at least full-height
   and the digits stay legible. Typing auto-advances, so a phone user taps once
   and types rather than aiming at individual blocks. */
@media (max-width: 420px) {
  .pf-phone__cc {
    gap: 4px;
    padding: 0 8px;
    font-size: .86rem;
  }

  .pf-phone__flag {
    font-size: .95rem;
  }

  .pf-digits {
    gap: 3px;
    padding: 5px 5px;
  }

  .pf-digit {
    height: 44px;
    font-size: .95rem;
    border-radius: 6px;
  }
}

.pf-hint {
  margin: 7px 0 0;
  font-family: var(--font-body);
  font-size: .78rem;
  color: var(--color-gray-600);
}

/* "optional" chip beside a label. Being obviously optional is the point —
   this field is recovery-only and must never read as a required email. */
.pf-optional {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 7px;
  border-radius: 999px;
  background: var(--color-gray-100);
  color: var(--color-gray-600);
  font-family: var(--font-body);
  font-size: .68rem;
  font-weight: 600;
  letter-spacing: .03em;
  text-transform: uppercase;
  vertical-align: middle;
}

/* Password field with the show/hide eye tucked inside. */
.pf-pw {
  position: relative;
}

.pf-pw .pf-input {
  padding-right: 44px;
}

.pf-eye {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: transparent;
  color: var(--color-gray-500);
  cursor: pointer;
  font-family: var(--font-body);
  transition: color .2s ease;
}

.pf-eye:hover {
  color: var(--color-text);
}

.pf-eye svg {
  width: 19px;
  height: 19px;
}

.pf-eye .pf-eye-off {
  display: none;
}

.pf-eye.is-shown .pf-eye-on {
  display: none;
}

.pf-eye.is-shown .pf-eye-off {
  display: block;
}

/* -------------------------------------------------------------- submit -- */

/* Brand dark blue at rest, accent orange on hover. */
.pf-submit {
  width: 100%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 18px;
  margin-top: 6px;
  border: 1px solid var(--pf-deep-surface);
  border-radius: 10px;
  background: var(--pf-deep-surface);
  color: var(--color-white);
  font-family: var(--font-body);
  font-size: .95rem;
  font-weight: 700;
  cursor: pointer;
  /* Colour only — never transform/scale, never a size change (UI Rules). */
  transition: background-color .2s ease, border-color .2s ease, box-shadow .2s ease;
}

.pf-submit:hover,
.pf-submit:focus-visible {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--color-white);
  outline: none;
  box-shadow: 0 0 0 3px var(--primary-bright-soft, rgba(255, 138, 0, .16));
}

.pf-submit:active {
  background: var(--primary-hover, #E07600);
  border-color: var(--primary-hover, #E07600);
  color: var(--color-white);
}

.pf-submit[disabled] {
  opacity: .6;
  cursor: not-allowed;
}

/* Quiet text link — "Change", "Forgot password?", "Resend code".
   Black at rest so it reads as text, underlined on hover so it reads as a link. */
.pf-textbtn {
  border: 0;
  background: transparent;
  padding: 0;
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: .86rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: color .2s ease;
}

.pf-textbtn:hover,
.pf-textbtn:focus-visible {
  color: var(--color-text);
  text-decoration: underline;
  outline: none;
}

/* Right-aligned row for a single trailing link, e.g. "Forgot password?". */
.pf-field--end {
  display: flex;
  justify-content: flex-end;
}

.pf-textbtn[disabled] {
  color: var(--color-gray-500);
  cursor: not-allowed;
  text-decoration: none;
}

/* --------------------------------------------------------- messaging  -- */

.pf-error {
  margin: 7px 0 0;
  font-family: var(--font-body);
  font-size: .8rem;
  color: var(--red, #C9293D);
}

.pf-status {
  margin: 0 0 20px;
  padding: 11px 13px;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-gray-060);
  font-family: var(--font-body);
  font-size: .85rem;
  color: var(--color-text);
}

.pf-alt {
  margin-top: 24px;
  text-align: center;
  font-family: var(--font-body);
  font-size: .88rem;
  color: var(--color-gray-600);
}

.pf-alt a {
  color: var(--accent);
  font-weight: 700;
  text-decoration: none;
}

.pf-alt a:hover {
  text-decoration: underline;
}

/* The number being signed in, shown above the password step. */
.pf-who {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin: 0 0 24px;
  padding: 12px 14px;
  border: 1px solid var(--color-gray-200);
  border-radius: 10px;
  background: var(--color-gray-060);
}

.pf-who__num {
  font-family: var(--font-body);
  font-size: .92rem;
  font-weight: 700;
  color: var(--color-text);
}

/* ----------------------------------------------------------- right side -- */

.pf-aside {
  background: var(--color-gray-060);
  border: 1px solid var(--color-gray-200);
  border-radius: 16px;
  padding: 40px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 560px;
}

/* Image slot. 16:10 — see AGENTS.md > Auth Artwork for the export spec.
   The box holds its ratio whether or not an image is in it, so dropping the
   artwork in later cannot shift the layout. */
.pf-aside__media {
  width: 100%;
  max-width: 460px;
  aspect-ratio: 16 / 10;
  border-radius: 12px;
  background: var(--color-gray-100);
  border: 1px dashed var(--color-gray-200);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  margin-bottom: 32px;
}

.pf-aside__media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}

/* Placeholder caption, removed once a real image lands in the slot. */
.pf-aside__slot {
  font-family: var(--font-body);
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--color-gray-350);
}

.pf-aside__title {
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 0 0 10px;
}

.pf-aside__text {
  font-family: var(--font-body);
  font-size: .92rem;
  line-height: 1.6;
  color: var(--color-gray-600);
  margin: 0;
  max-width: 380px;
}

.pf-dots {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-top: 28px;
}

.pf-dots span {
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--color-gray-300);
}

.pf-dots span.is-active {
  width: 20px;
  background: var(--accent);
}

/* ---------------------------------------------------------- responsive -- */

@media (max-width: 940px) {
  .pf-auth__grid {
    grid-template-columns: minmax(0, 1fr);
    max-width: 480px;
  }

  /* The marketing panel is decoration; on a phone the form gets the screen. */
  .pf-aside {
    display: none;
  }

  .pf-auth__panel {
    min-height: 0;
    padding: 36px 26px;
  }

  .pf-auth__brand {
    margin-bottom: 32px;
  }

  .pf-auth__title {
    font-size: 1.6rem;
  }
}

@media (max-width: 420px) {
  .pf-auth {
    padding: 16px;
  }

  .pf-auth__panel {
    padding: 28px 20px;
  }
}
