/* Customer sign-in, passcode reset and account setup: one shell for all three
   (www/login.html, www/account_setup.html), in the customer app's own look:
   lavender canvas on phones; on desktop the form on white beside the app on
   its purple. Buttons are pills and fields are 16px-rounded, as in the app.
   Moving between these pages keeps the purple panel still (view transitions). */
@import url("https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@500;700;800&family=Inter:wght@400;500;600&display=swap");
@view-transition { navigation: auto }
@media (prefers-reduced-motion: reduce) { @view-transition { navigation: none } }
.am-art { view-transition-name: am-art }
.am-top { view-transition-name: am-top }

/* ── Shell ─────────────────────────────────────────────────────
   The customer app's own look (customer-wallet.css) and the website's:
   lavender canvas, white 24px card, black pill button, purple accent only
   for focus and the app mark. */
body:has(.am-customer) {
  --am-canvas: #f2f1f6; --am-ink: #141414; --am-ink-2: #6b6a75; --am-ink-3: #9a99a4; --am-line: #e9e8ef;
  --am-soft: #f4f3f8; --am-purple: #6c5ce7; --am-accent-soft: rgba(139, 124, 246, .28);
  --am-shadow: 0 1px 2px rgb(20 20 40 / .04), 0 8px 24px rgb(20 20 40 / .05);
}
/* Full-bleed: Frappe's page frame (a 1290px container under 60px of top padding) is lifted. */
body:has(.am-customer) .page-content-wrapper { padding: 0 !important; margin: 0 !important }
body:has(.am-customer) :is(.page_content, main.container, main > .container) {
  display: block; width: 100%; max-width: none !important; margin: 0 !important; padding: 0 !important; min-height: 100dvh;
}
/* Base: the reset and setup pages have no Frappe styles under them, so the shell
   brings its own type, fields and buttons. */
body:has(.am-customer) { margin: 0; background: var(--am-canvas) }
.am-customer { color: var(--am-ink); font: 400 15px/1.5 Inter, system-ui, -apple-system, "Segoe UI", sans-serif; -webkit-font-smoothing: antialiased }
.am-customer *, .am-customer *::before, .am-customer *::after { box-sizing: border-box }
.am-customer a { color: inherit; text-decoration: none }
.am-customer label { display: grid; gap: 7px; color: var(--am-ink); font-size: 13.5px; font-weight: 600 }
.am-customer .form-control {
  width: 100%; border: 1px solid var(--am-line); outline: 0; color: var(--am-ink);
  font: 500 16px/1.3 Inter, system-ui, sans-serif; transition: background-color .15s, border-color .15s, box-shadow .15s;
}
.am-customer .form-control::placeholder { color: var(--am-ink-3) }
.am-customer .es-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; width: 100%; padding: 0 24px;
  border: 1px solid var(--am-ink); color: #fff; cursor: pointer; text-align: center;
}
.am-customer .es-button:disabled { cursor: default }
.am-customer .es-button.am-secondary { min-height: 54px; margin-top: 8px; border-radius: 999px; border-color: var(--am-line); background: #fff; color: var(--am-ink); font: 650 16px/1 Inter, system-ui, sans-serif }
.am-customer .es-button.am-secondary:hover { background: var(--am-soft) }
.am-customer .am-card { background: #fff }
.am-customer .am-digits { letter-spacing: .35em }
.am-customer .am-digits::placeholder { letter-spacing: .2em }
.am-facts { display: grid; gap: 8px; margin: 0 }
.am-facts p { display: grid; gap: 2px; margin: 0; padding: 12px 16px; border-radius: 16px; background: var(--am-soft) }
.am-facts small { color: var(--am-ink-2); font-size: 12.5px }
.am-facts b { font-size: 16px; letter-spacing: .02em }
.am-sent { margin: 0; padding: 12px 16px; border-radius: 16px; background: #ecfaf5; color: #1d6b55; font-size: 13.5px; line-height: 1.45 }
.am-hint { margin: -4px 0 0; color: var(--am-ink-2); font-size: 12.5px; line-height: 1.5 }
.am-link { justify-self: center; min-height: 44px; padding: 0 12px; border: 0; border-radius: 999px; background: none; color: var(--am-ink-2); font: 600 14px/1 Inter, system-ui, sans-serif; cursor: pointer }
.am-link:hover:not(:disabled) { color: var(--am-ink) }
.am-link:disabled { color: var(--am-ink-3); cursor: default }
.am-step[hidden], .am-error[hidden] { display: none !important }
/* The second step arrives with a short fade, not a jump. */
@media (prefers-reduced-motion: no-preference) {
  .am-step:not([hidden]) { animation: am-step .28s cubic-bezier(.2, .8, .2, 1) both }
  .am-card { animation: am-step .3s cubic-bezier(.2, .8, .2, 1) both }
}
@keyframes am-step { from { opacity: 0; transform: translateY(6px) } }

.am-pane { display: flex; flex-direction: column; align-items: center; width: 100% }
.am-art { display: none }
.am-customer {
  display: flex; flex-direction: column; align-items: center; min-height: 100dvh; box-sizing: border-box;
  padding: max(16px, env(safe-area-inset-top, 0px)) 16px max(28px, env(safe-area-inset-bottom, 0px));
}
.am-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: min(440px, 100%); margin-bottom: clamp(28px, 9vh, 88px) }
.am-brand { display: inline-flex; align-items: center; gap: 10px; color: var(--am-ink); font: 800 18px/1 "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -.02em }
.am-brand img { width: 36px; height: 36px; border-radius: 10px }
.am-language { display: inline-flex; padding: 4px; border-radius: 999px; background: #fff; box-shadow: var(--am-shadow) }
body:has(.am-customer) .am-language a {
  display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 40px; padding: 0 12px;
  border-radius: 999px; color: var(--am-ink-2) !important; font-size: 13.5px; font-weight: 600; text-decoration: none !important;
}
body:has(.am-customer) .am-language a[aria-current] { background: var(--am-ink); color: #fff !important }

body:has(.am-customer) .am-customer .for-login { width: min(440px, 100%) }
body:has(.am-customer) .am-customer .am-card {
  width: 100%; max-width: none; padding: 32px 28px 26px; border: 0; border-radius: 24px; box-shadow: var(--am-shadow);
}
.am-title { margin: 0; color: var(--am-ink); font: 800 30px/1.15 "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -.03em }
.am-lead { margin: 8px 0 24px; color: var(--am-ink-2); font-size: 15px; line-height: 1.5 }
.am-customer[lang="am"] .am-title { letter-spacing: normal; line-height: 1.3 }

body:has(.am-customer) .am-phone-login { display: grid; gap: 16px }
body:has(.am-customer) .am-phone-login label { display: grid; gap: 7px; font-size: 13.5px !important }
body:has(.am-customer) .am-customer .form-control {
  height: 54px; min-height: 54px; padding: 12px 20px; border-radius: 16px !important; border-color: var(--am-line) !important;
  background: var(--am-soft) !important; font-size: 16px; font-weight: 500;
}
body:has(.am-customer) .am-customer .form-control:focus { border-color: var(--am-purple) !important; background: #fff !important; box-shadow: 0 0 0 4px var(--am-accent-soft) !important }
body:has(.am-customer) .am-phone-login input[name=passcode] { letter-spacing: .35em }
body:has(.am-customer) .am-phone-login input[name=passcode]::placeholder { letter-spacing: .2em }
body:has(.am-customer) .am-customer .es-button[data-variant="solid"] {
  min-height: 54px; margin-top: 4px; border-radius: 999px !important; background: var(--am-ink) !important; border-color: var(--am-ink) !important;
  font: 650 16px/1 Inter, system-ui, sans-serif !important;
}
body:has(.am-customer) .am-customer .es-button[data-variant="solid"]:hover { background: #000 !important }
body:has(.am-customer) .am-customer .es-button[disabled] { opacity: .55 }
body:has(.am-customer) .am-customer :is(.es-button, a):focus-visible { outline: 3px solid var(--am-accent-soft); outline-offset: 3px }
body:has(.am-customer) .am-error { margin: 0; padding: 11px 14px; border-radius: 14px; background: #fdf1f0; color: #a32d2d; font-size: 13.5px; line-height: 1.45 }
body:has(.am-customer) .am-phone-links { margin: 0; text-align: center; font-size: 14px }
body:has(.am-customer) .am-phone-links a { display: inline-flex; align-items: center; min-height: 44px; color: var(--am-ink) !important; font-weight: 600 }
.am-phone-note { margin: 10px 0 0; padding-top: 18px; border-top: 1px solid var(--am-line); color: var(--am-ink-2); font-size: 13.5px; line-height: 1.5; text-align: center }

body:has(.am-customer) a.am-track {
  display: inline-flex; align-items: center; gap: 10px; min-height: 52px; margin-top: 18px; padding: 0 20px;
  border-radius: 999px; background: #fff; box-shadow: var(--am-shadow); color: var(--am-ink) !important; font-size: 14.5px; font-weight: 600;
}
body:has(.am-customer) a.am-track:hover { text-decoration: none; box-shadow: 0 0 0 1px var(--am-line), var(--am-shadow) }
.am-track svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round }
.am-track svg:first-child { color: var(--am-purple) }

@media (max-width: 480px) {
  body:has(.am-customer) .am-customer .am-card { padding: 26px 20px 22px }
  .am-title { font-size: 27px }
}

/* ── Desktop: form on white beside the app, on the app's purple ─────────── */
@media (min-width: 960px) {
  body:has(.am-art) { background: #fff !important }
  .am-customer:has(.am-art) {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); gap: 24px; align-items: stretch;
    padding: 24px; min-height: 100dvh; background: #fff;
  }
  .am-customer:has(.am-art) .am-pane { align-items: stretch; min-height: calc(100dvh - 48px); padding: 12px clamp(24px, 6vw, 96px) 16px }
  .am-customer:has(.am-art) .am-top { width: 100%; margin-bottom: 40px }
  body:has(.am-art) .am-customer .for-login { width: min(400px, 100%); margin: auto 0 }
  body:has(.am-art) .am-customer .am-card { padding: 0; border-radius: 0; box-shadow: none; background: transparent }
  .am-customer:has(.am-art) .am-title { font-size: clamp(36px, 3.4vw, 48px); letter-spacing: -.035em }
  .am-customer:has(.am-art) .am-lead { margin: 12px 0 32px; font-size: 16px }
  .am-customer:has(.am-art) .am-phone-note { text-align: left }
  body:has(.am-art) .am-phone-links { text-align: left }
  body:has(.am-art) a.am-track { align-self: flex-start; margin-top: 28px; background: var(--am-soft); box-shadow: none }
  body:has(.am-art) a.am-track:hover { background: var(--am-line) }

  .am-art {
    display: block; position: relative; overflow: hidden; min-height: 600px; border-radius: 32px;
    container-type: inline-size;
    background:
      radial-gradient(120% 80% at 85% 10%, rgb(255 255 255 / .22), transparent 55%),
      linear-gradient(160deg, #a597ff 0%, #8b7cf6 38%, #6c5ce7 100%);
  }
  .am-cloud { position: absolute; height: 46px; border-radius: 999px; background: #fff }
  .am-cloud::before, .am-cloud::after { content: ""; position: absolute; bottom: 0; border-radius: 50%; background: #fff }
  .am-cloud::before { left: 18%; width: 48%; height: 160% }
  .am-cloud::after { left: 48%; width: 36%; height: 120% }
  .am-cloud-1 { top: 9%; left: -4%; width: 180px }
  .am-cloud-2 { top: 6%; right: 8%; width: 140px; opacity: .9 }

  /* The phone: upright (no tilt, so edges and text stay crisp), a thin dark frame with a fine highlight edge,
     side buttons, a status bar with the camera pill, the app screenshot under it, and the home indicator. */
  .am-phone {
    --am-bezel: 9px;
    --am-phone-radius: clamp(34px, 7.4cqw, 48px);
    position: absolute; top: 47%; left: 52%; height: min(66%, 600px, 92cqw); aspect-ratio: 430 / 925;
    box-sizing: border-box; padding: var(--am-bezel); border-radius: var(--am-phone-radius);
    background: linear-gradient(145deg, #2e2c35 0%, #17161b 45%, #0e0d11 100%);
    box-shadow: inset 0 0 0 1px rgb(255 255 255 / .14), inset 0 0 0 2.5px #0a0a0c,
      0 2px 0 rgb(255 255 255 / .06), 0 40px 70px -28px rgb(24 14 80 / .62), 0 12px 24px -12px rgb(24 14 80 / .4);
    transform: translate(-50%, -50%);
  }
  /* Side buttons: volume on the left, power on the right. */
  .am-phone::before, .am-phone::after { content: ""; position: absolute; width: 3px; border-radius: 3px; background: #24232a }
  .am-phone::before { left: -3px; top: 21%; height: 11%; box-shadow: 0 -32px 0 -0.5px #24232a }
  .am-phone::after { right: -3px; top: 25%; height: 16% }
  .am-phone-screen {
    position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden;
    border-radius: calc(var(--am-phone-radius) - var(--am-bezel)); background: #f2f1f6; isolation: isolate;
  }
  .am-phone-status {
    position: relative; flex: none; display: flex; align-items: center; justify-content: space-between;
    height: 7.2%; padding: 0 9% 0 11%; color: #141414; font: 600 clamp(10px, 2.2cqw, 13px)/1 Inter, system-ui, sans-serif;
  }
  .am-phone-status svg { width: 19%; height: auto; fill: currentColor }
  .am-phone-island { position: absolute; left: 50%; top: 50%; width: 30%; height: 52%; border-radius: 999px; background: #0a0a0c; transform: translate(-50%, -42%) }
  .am-phone-screen img { display: block; flex: 1 1 auto; min-height: 0; width: 100%; height: auto; object-fit: cover; object-position: top }
  .am-phone-home { position: absolute; left: 50%; bottom: 1.2%; width: 34%; height: 4px; border-radius: 999px; background: #141414; opacity: .85; transform: translateX(-50%) }

  .am-bubble {
    position: absolute; top: 18%; left: 12%; display: grid; place-items: center; width: 88px; height: 88px;
    border-radius: 50%; background: #fff; box-shadow: 0 20px 40px -18px rgb(30 20 90 / .5);
  }
  .am-bubble::after { content: ""; position: absolute; bottom: -6px; right: 14px; width: 22px; height: 22px; background: #fff; transform: rotate(45deg); border-radius: 4px }
  .am-bubble svg { position: relative; z-index: 1; width: 42px; height: 42px; fill: none; stroke: #6c5ce7; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round }

  .am-chip {
    position: absolute; display: inline-flex; align-items: center; gap: 8px; padding: 12px 18px; border-radius: 999px;
    background: #fff; color: #141414; font-size: 14px; font-weight: 650; white-space: nowrap;
    box-shadow: 0 18px 36px -18px rgb(30 20 90 / .55);
  }
  .am-chip i { width: 10px; height: 10px; border-radius: 50%; background: #3db49a; box-shadow: 0 0 0 4px rgb(61 180 154 / .18) }
  .am-chip svg { width: 18px; height: 18px; fill: none; stroke: #6c5ce7; stroke-width: 2; stroke-linejoin: round }
  .am-chip-status { top: 38%; right: 7%; }
  .am-chip-sms { top: 60%; left: 8%; }

  .am-lock {
    position: absolute; bottom: 24%; right: 11%; display: grid; place-items: center; width: clamp(48px, 10cqw, 68px); aspect-ratio: 1;
    border-radius: 20px; background: #fff; box-shadow: 0 20px 40px -18px rgb(30 20 90 / .5); transform: rotate(8deg);
  }
  .am-lock svg { width: 50%; height: 50%; fill: none; stroke: #6c5ce7; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round }

  .am-art-caption {
    position: absolute; left: 40px; right: 40px; bottom: 34px; margin: 0; color: #fff;
    font: 800 clamp(20px, 1.8vw, 26px)/1.2 "Plus Jakarta Sans", Inter, sans-serif; letter-spacing: -.02em; text-wrap: balance;
  }
  .am-customer[lang="am"] .am-art-caption { letter-spacing: normal; line-height: 1.4 }
}
@media (min-width: 960px) and (prefers-reduced-motion: no-preference) {
  .am-phone { animation: am-rise .7s cubic-bezier(.2, .8, .2, 1) both }
  .am-bubble, .am-chip, .am-lock { animation: am-pop .5s .35s cubic-bezier(.2, .8, .2, 1.2) both }
  .am-chip-sms { animation-delay: .5s } .am-lock { animation-delay: .6s }
}
@keyframes am-rise { from { opacity: 0; transform: translate(-50%, -45%) } }
@keyframes am-pop { from { opacity: 0; scale: .85 } }

/* Error page: the technical detail stays available, folded away. */
.am-error-details { margin-top: 18px; color: var(--am-ink-2); font-size: 12.5px }
.am-error-details summary { cursor: pointer; min-height: 44px; display: flex; align-items: center }
.am-error-details pre { max-height: 300px; overflow: auto; padding: 12px; border-radius: 12px; background: var(--am-soft); white-space: pre-wrap; word-break: break-word }

/* Staff pages in the same shell: accents are black, not purple (staff UI rule). */
.am-staff { --am-purple: #141414; --am-accent-soft: rgb(20 20 20 / .14) }
/* Status and error lines that a script fills: hidden while empty. */
.am-if-text:empty { display: none }
.am-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 4px 12px }
.am-row-links { margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--am-line) }
.am-row-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: 14px; font-weight: 600; color: var(--am-ink) }
.am-row-links a:hover { text-decoration: underline }
.am-customer #reset-done { margin-top: 8px }
.am-customer [hidden] { display: none !important }

/* Staff sign-in: Frappe's form markup inside the shell. */
.am-frappe-login .for-login, .am-frappe-login .for-forgot, .am-frappe-login .for-signup, .am-frappe-login .for-email-login, .am-frappe-login .for-login-with-email-link { width: min(440px, 100%) }
body:has(.am-frappe-login) .am-frappe-login .page-card {
  width: 100%; max-width: none; margin: 0; padding: 32px 28px 26px; border: 0 !important; border-radius: 24px; box-shadow: var(--am-shadow); background: #fff;
}
body:has(.am-frappe-login) .am-frappe-login .page-card-head::before { content: none !important; display: none }
body:has(.am-frappe-login) .am-frappe-login .page-card-head h4 { margin: 0; font: 800 30px/1.15 "Plus Jakarta Sans", Inter, sans-serif !important; letter-spacing: -.03em }
body:has(.am-frappe-login) .am-frappe-login .page-card-subtitle { margin-top: 6px; color: var(--am-ink-2) !important; font-size: 15px !important }
body:has(.am-frappe-login) .am-frappe-login .form-control {
  height: 54px; min-height: 54px; padding: 12px 20px; border-radius: 16px !important; border-color: var(--am-line) !important;
  background: var(--am-soft) !important; font-size: 16px; font-weight: 500;
}
body:has(.am-frappe-login) .am-frappe-login .form-control:focus { border-color: var(--am-ink) !important; background: #fff !important; box-shadow: 0 0 0 4px var(--am-accent-soft) !important }
body:has(.am-frappe-login) .am-frappe-login .password-field .form-control { padding-right: 46px }
body:has(.am-frappe-login) .am-frappe-login .toggle-password { right: 18px }
body:has(.am-frappe-login) .am-frappe-login .es-button { min-height: 54px; border-radius: 999px !important; font: 650 16px/1 Inter, system-ui, sans-serif !important }
body:has(.am-frappe-login) .am-frappe-login .es-button[data-variant="solid"] { background: var(--am-ink) !important; border-color: var(--am-ink) !important; color: #fff !important }
body:has(.am-frappe-login) .am-frappe-login .es-button:not([data-variant="solid"]) { background: #fff !important; border: 1px solid var(--am-line) !important; color: var(--am-ink) !important }
body:has(.am-frappe-login) .am-frappe-login .es-button:not([data-variant="solid"]):hover { background: var(--am-soft) !important }
body:has(.am-frappe-login) .am-frappe-login :is(.forgot-password-message, .sign-up-message) a { color: var(--am-ink) !important; font-weight: 600 }
.am-frappe-login .am-track svg:first-child { color: var(--am-ink) }
body:has(.am-frappe-login) .am-frappe-login :is(.login-content, .page-card) { width: 100% !important; max-width: none !important }
body:has(.am-frappe-login) .am-frappe-login .btn-primary:not(.es-button[data-variant]) {
  min-height: 54px; border-radius: 999px !important; background: var(--am-ink) !important; border: 1px solid var(--am-ink) !important;
  color: #fff !important; font: 650 16px/1 Inter, system-ui, sans-serif !important; box-shadow: none !important;
}
body:has(.am-frappe-login) .am-frappe-login .btn-primary:hover { background: #000 !important }
body:has(.am-frappe-login) .am-frappe-login section:is(.for-login, .for-forgot, .for-signup, .for-email-login, .for-login-with-email-link) { width: min(440px, 100%) !important; max-width: none !important }
/* "Express" in a lighter weight, as in the customer app's header and the website logo. */
.am-brand-light { font-weight: 500 }
