/* ===== Pay portal landing (resources/views/pay/landing.blade.php) =====
   Shared background, card, stub and button styles live in portal.css. */

.landing {
  position: relative; z-index: 1;
  max-width: 1120px; min-height: 100vh; margin: 0 auto; padding: 36px 32px 28px;
  display: grid; gap: 0 72px;
  grid-template-columns: 1fr 420px;
  /* Empty 1fr rows above and below keep the intro + steps centred beside the card. */
  grid-template-rows: auto 1fr auto auto 1fr auto;
  grid-template-areas:
    "logo   logo"
    ".      form"
    "intro  form"
    "steps  form"
    ".      form"
    "footer footer";
  align-items: center;
}

/* Logo */
.landing-logo { grid-area: logo; align-self: start; justify-self: start; }

/* Intro */
.landing-intro { grid-area: intro; align-self: end; padding-top: 32px; }
body.pay-home .landing-intro h1 {
  font-size: clamp(2.2rem, 4.6vw, 3.6rem); font-weight: 800; line-height: 1.04;
  letter-spacing: -.035em; color: #fff; max-width: 13ch; margin-bottom: 18px;
}
.landing-intro .hero-sub { font-size: 1.02rem; line-height: 1.6; color: rgba(255,255,255,.72); max-width: 42ch; margin: 0; }

/* Steps: a real sequence, lit up as the visitor progresses */
.landing-steps { grid-area: steps; align-self: start; display: block; margin: 0; padding: 40px 0 24px; }
.landing-steps ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 4px; max-width: 420px; }
.landing-step {
  display: flex; gap: 14px; align-items: center; padding: 12px 14px; border-radius: 12px;
  opacity: .55; transition: opacity .3s, background-color .3s;
}
.landing-step-num {
  width: 28px; height: 28px; flex-shrink: 0; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: .8rem; font-weight: 700; color: #fff;
  background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.22);
  transition: background-color .3s, border-color .3s, color .3s, transform .3s;
}
.landing-step-title { font-size: .9rem; font-weight: 700; margin-bottom: 2px; }
.landing-step-desc  { font-size: .8rem; line-height: 1.5; color: rgba(255,255,255,.62); }
.landing-step.is-active { opacity: 1; background: rgba(255,255,255,.06); }
.landing-step.is-active .landing-step-num { background: #fff; border-color: #fff; color: var(--navy); transform: scale(1.08); }
.landing-step.is-done { opacity: .9; }
.landing-step.is-done .landing-step-num { background: var(--signal); border-color: var(--signal); }

/* Form column */
.landing-form { grid-area: form; align-self: center; perspective: 1200px; }

/* Tilts towards the cursor (pay-landing.js); the look comes from .portal-card */
.landing-card {
  transform-style: preserve-3d;
  transition: transform .5s cubic-bezier(.2,.8,.2,1);
  will-change: transform;
}
.landing-card.is-tilting { transition: transform .08s linear; }

/* Cursor-following light */
.landing-card-glow {
  position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity .3s;
  background: radial-gradient(320px circle at var(--gx, 50%) var(--gy, 0%), rgba(61,111,196,.14), transparent 60%);
}
.landing-card:hover .landing-card-glow { opacity: 1; }

/* Decorative invoice stub (.portal-stub) that fills in as the code is typed */
.landing-stub { grid-template-columns: auto 1fr; }
.landing-stub-code {
  grid-row: 1 / span 2; grid-column: 2; justify-self: end;
  display: flex; gap: 6px; font-family: 'Geist Mono', monospace; font-size: 1.15rem; font-weight: 600;
}
.landing-stub-code span { width: 14px; text-align: center; color: rgba(255,255,255,.35); transition: color .2s, transform .2s; }
.landing-stub-code span.is-filled { color: #fff; transform: translateY(-1px); }

/* Code entry */
.landing-label { display: block; font-size: .8rem; font-weight: 600; color: var(--muted); margin-bottom: 8px; }

/* No-JS fallback: a single plain field. JS hides it behind the boxes. */
body.pay-home .landing-code-plain {
  width: 100%; padding: 14px 16px; border-radius: 12px; border: 1.5px solid #DCE3EF; background: var(--bg);
  font-family: 'Geist Mono', monospace; font-size: 1.2rem; font-weight: 600; letter-spacing: .2em;
  text-transform: uppercase; text-align: center; color: var(--text); outline: none;
}
body.pay-home .landing-code-plain:focus { border-color: var(--signal); box-shadow: 0 0 0 4px rgba(61,111,196,.18); }
.landing-code-form.is-enhanced .landing-code-plain {
  position: absolute; width: 1px; height: 1px; padding: 0; border: 0; opacity: 0; pointer-events: none;
}

.landing-boxes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
/* No transforms on the boxes: iOS Safari draws a focused input's text out of
   place while the input is transformed or animating a transform. */
.landing-box {
  -webkit-appearance: none; appearance: none;
  width: 100%; aspect-ratio: 4 / 5; min-width: 0;
  border: 1.5px solid #DCE3EF; border-radius: 12px; background: var(--bg);
  font-family: 'Geist Mono', monospace; font-size: 1.5rem; font-weight: 600; text-align: center; text-transform: uppercase;
  color: var(--text); caret-color: var(--signal); outline: none; padding: 0;
  transition: border-color .15s, box-shadow .15s, background-color .15s;
}
.landing-box:focus { border-color: var(--signal); background: #fff; box-shadow: 0 0 0 4px rgba(61,111,196,.18); }
.landing-box.is-filled { background: #fff; border-color: #B8C7E3; animation: landing-fill .35s ease-out; }
.landing-box.is-invalid { border-color: var(--red); box-shadow: 0 0 0 4px rgba(220,38,38,.14); animation: landing-invalid .4s ease-out; }
.landing-code-form.has-error .landing-box,
.landing-code-form.has-error .landing-code-plain { border-color: rgba(220,38,38,.55); }
.landing-code-form.has-error .landing-hint { animation: landing-shake .45s; }

@keyframes landing-fill { 0% { background-color: #DCE6F8; } 100% { background-color: #fff; } }
@keyframes landing-invalid { 0% { background-color: #FEE2E2; } 100% { background-color: var(--bg); } }
@keyframes landing-shake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-6px); } 40% { transform: translateX(5px); }
  60% { transform: translateX(-3px); } 80% { transform: translateX(2px); }
}

.landing-hint { min-height: 2.6em; margin: 10px 0 0; font-size: .78rem; line-height: 1.45; color: var(--muted); text-align: center; }
.landing-code-form.has-error .landing-hint,
.landing-hint.is-warning { color: var(--red); }

.landing-submit {
  position: relative; width: 100%; margin-top: 10px; padding: 15px; border: 0; border-radius: 12px;
  background: var(--navy); color: #fff; font: 700 .95rem 'Geist', sans-serif; cursor: pointer;
  transition: background-color .2s, transform .2s, box-shadow .2s, opacity .2s;
}
.landing-submit:hover:not(:disabled) { background: #16305E; transform: translateY(-1px); box-shadow: 0 10px 28px -8px rgba(12,31,74,.55); }
.landing-submit:focus-visible { outline: 3px solid var(--ice); outline-offset: 3px; }
.landing-submit:disabled { opacity: .45; cursor: not-allowed; }
.landing-submit.is-ready { animation: landing-ready 1.8s ease-in-out infinite; }
@keyframes landing-ready {
  0%, 100% { box-shadow: 0 0 0 0 rgba(61,111,196,.45); }
  50%      { box-shadow: 0 0 0 8px rgba(61,111,196,0); }
}
.landing-submit-busy { display: none; }
.landing-code-form.is-busy .landing-submit-label { display: none; }
.landing-code-form.is-busy .landing-submit-busy { display: inline-flex; align-items: center; gap: 10px; }
.landing-code-form.is-busy .landing-submit-busy::before {
  content: ""; width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255,255,255,.35); border-top-color: #fff; animation: landing-spin .7s linear infinite;
}
@keyframes landing-spin { to { transform: rotate(360deg); } }

.landing-alt { margin: 20px 0 0; padding-top: 18px; border-top: 1px solid var(--border); font-size: .8rem; line-height: 1.5; color: var(--muted); text-align: center; }
.landing-alt strong { color: var(--text); }

.landing-account { margin: 18px 0 0; text-align: center; font-size: .84rem; color: rgba(255,255,255,.65); }
.landing-account a { color: #fff; font-weight: 600; text-decoration: underline; text-decoration-color: rgba(255,255,255,.35); text-underline-offset: 3px; }
.landing-account a:hover { text-decoration-color: #fff; }

body.pay-home .landing-footer {
  grid-area: footer; padding: 28px 0 0; border: 0; background: none;
  font-size: .74rem; color: rgba(255,255,255,.45); text-align: left;
}

/* Tablet / phone: one column, form right under the headline */
@media (max-width: 920px) {
  .landing {
    grid-template-columns: 1fr; gap: 0;
    grid-template-areas: "logo" "intro" "form" "steps" "footer";
    grid-template-rows: none;
    max-width: 520px; padding: 22px 16px 24px;
  }
  .landing-intro { padding-top: 36px; }
  body.pay-home .landing-intro h1 { font-size: 2.2rem; }
  .landing-intro .hero-sub { font-size: .95rem; }
  .landing-form { padding-top: 28px; }
  .landing-steps { padding-top: 28px; }
  body.pay-home .landing-footer { text-align: center; }
}
@media (max-width: 400px) {
      .landing-boxes { gap: 6px; }
  .landing-box { font-size: 1.25rem; border-radius: 10px; }
}

@media (prefers-reduced-motion: reduce) {
  .landing-card, .landing-box, .landing-step, .landing-step-num, .landing-submit { transition: none; }
  .landing-box.is-filled, .landing-box.is-invalid,
  .landing-code-form.has-error .landing-hint, .landing-submit.is-ready { animation: none; }
}
