/* Sign in page: logo and form on the left, tinted panel with the app on a phone on the right */

.auth {
  min-height: 100dvh; max-width: calc(var(--page-max) + 112px); margin: 0 auto;
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: clamp(24px, 4vw, 72px);
  padding: 40px clamp(20px, 4vw, 56px);
}
.auth-main { display: flex; flex-direction: column; gap: 40px; padding: 8px 0 0 clamp(0px, 3vw, 40px); }
.auth-main > .logo { font-size: 1.2rem; }
.auth-main > .logo .logo-img { height: 30px; }

.auth-box { width: 100%; max-width: 360px; margin-top: clamp(24px, 9vh, 96px); display: grid; gap: 32px; }
.auth-head h1 { font-size: clamp(1.8rem, 3vw, 2.2rem); letter-spacing: -0.035em; }
.auth-head p { margin-top: 12px; color: var(--ink-2); max-width: 32ch; }

/* Filled inputs, no borders */
.auth-form { display: grid; gap: 20px; }
.auth-form .input {
  min-height: 56px; padding: 0 18px; border: 0;
  background: color-mix(in srgb, var(--surface-2) 70%, var(--bg));
}
.auth-form .input::placeholder { color: var(--ink-3); }
.auth-form .input:focus { background: var(--surface); box-shadow: 0 0 0 2px var(--brand); }
.auth-form .input[aria-invalid="true"] { box-shadow: 0 0 0 2px var(--neg); }

.pw-wrap { position: relative; }
.pw-wrap .input { padding-right: 84px; }
.pw-toggle {
  position: absolute; right: 8px; top: 50%; transform: translateY(-50%);
  height: 40px; padding: 0 16px; border: 0; border-radius: 10px; cursor: pointer;
  background: var(--surface); color: var(--ink); font-weight: 600; font-size: .85rem;
  box-shadow: 0 1px 2px color-mix(in srgb, var(--brand-900) 6%, transparent);
}
.pw-toggle:hover { color: var(--brand); }

.forgot-row { padding: 6px 0 0 4px; }
.forgot-row .link-btn { text-decoration-color: currentColor; }

.form-error, .form-ok { font-size: .9rem; padding: 12px 14px; border-radius: var(--r-control); }
.form-error { background: var(--neg-soft); color: var(--neg); }
.form-ok { background: var(--pos-soft); color: var(--pos); }

.auth-actions { display: grid; gap: 20px; margin-top: 40px; }
.auth-switch { font-size: .93rem; color: var(--ink-2); text-align: center; }
.auth-switch .link-btn { color: var(--ink); text-decoration-color: currentColor; font-weight: 520; }
.btn-submit { min-height: 56px; font-size: 1rem; }

.oauth { display: grid; gap: 20px; }
.divider { display: flex; align-items: center; gap: 14px; color: var(--ink-3); font-size: .85rem; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.btn-google { min-height: 52px; }
.btn-google svg { width: 18px; height: 18px; }

.auth-foot { margin-top: auto; font-size: .85rem; color: var(--ink-3); max-width: 360px; }

/* Mode visibility */
[data-show] { display: none; }
[data-mode="signin"] [data-show~="signin"],
[data-mode="signup"] [data-show~="signup"],
[data-mode="forgot"] [data-show~="forgot"],
[data-mode="reset"] [data-show~="reset"] { display: revert; }
[data-mode="signin"] .field[data-show~="signin"],
[data-mode="signup"] .field[data-show~="signup"],
[data-mode="forgot"] .field[data-show~="forgot"],
[data-mode="reset"] .field[data-show~="reset"],
[data-mode="signin"] .oauth[data-show~="signin"],
[data-mode="signup"] .oauth[data-show~="signup"] { display: grid; }

/* Right panel */
.auth-art { position: relative; }
.art-panel {
  position: sticky; top: 40px; height: min(calc(100dvh - 80px), 860px); min-height: 620px;
  border-radius: var(--r-media); overflow: hidden;
  background:
    radial-gradient(70% 60% at 85% 20%, color-mix(in srgb, var(--brand-soft) 90%, #fff) 0%, transparent 70%),
    color-mix(in srgb, var(--brand-soft) 70%, var(--bg));
  display: grid; place-items: center;
}

/* Phone */
.art-phone {
  position: relative; width: 290px; aspect-ratio: 9 / 19; margin-left: 30%;
  border-radius: 46px; padding: 10px; background: var(--brand-900);
  box-shadow: 0 40px 80px -30px color-mix(in srgb, var(--brand-900) 45%, transparent), inset 0 0 0 2px var(--night-ring);
  transform: rotate(4deg);
}
.art-notch { position: absolute; z-index: 2; left: 50%; top: 20px; width: 92px; height: 26px; margin-left: -46px; border-radius: 999px; background: var(--brand-900); }
.art-screen {
  height: 100%; border-radius: 37px; overflow: hidden; background: var(--bg); color: var(--ink);
  padding: 56px 14px 0; display: flex; flex-direction: column; gap: 12px; font-size: .72rem;
}
.art-top { display: flex; justify-content: space-between; align-items: center; font-weight: 650; font-size: .78rem; }
.art-av { width: 26px; height: 26px; border-radius: 32%; display: grid; place-items: center; background: var(--brand-soft); color: var(--brand); font-size: .6rem; }
.art-bal {
  border-radius: 16px; padding: 14px; color: var(--on-brand); display: grid; gap: 4px;
  background: radial-gradient(90% 120% at 0% 0%, var(--brand-550) 0%, transparent 60%), var(--brand-600);
}
.art-bal > span:first-child { opacity: .75; font-size: .66rem; }
.art-bal strong { font-family: var(--font-display); font-size: 1.55rem; letter-spacing: -0.04em; line-height: 1.05; }
.art-bal small { font-size: .55em; opacity: .7; margin-right: 2px; vertical-align: .5em; }
.art-chip { justify-self: start; margin-top: 4px; padding: 3px 8px; border-radius: 999px; background: rgb(255 255 255 / .14); font-size: .6rem; font-weight: 600; }
.art-tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.art-tiles span { display: grid; gap: 8px; padding: 10px; border-radius: 12px; font-weight: 600; font-size: .66rem; }
.art-tiles i { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: .75rem; color: #fff; }
.t-in { background: var(--pos-soft); } .t-in i { background: var(--pos); }
.t-out { background: var(--brand-soft); } .t-out i { background: var(--brand); color: var(--brand-ink); }
.t-mem { background: color-mix(in srgb, var(--brand-soft) 55%, var(--surface)); } .t-mem i { background: var(--brand-400); }
.t-share { background: var(--surface-2); } .t-share i { background: var(--ink); color: var(--bg); }
.art-mini { display: grid; gap: 6px; }
.art-mini > span { font-weight: 650; font-size: .7rem; }
.art-mini div { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border-radius: 10px; background: var(--surface); }
.art-mini i { width: 18px; height: 18px; border-radius: 50%; background: var(--pos-soft); flex: none; }
.art-mini em { flex: 1; font-style: normal; font-size: .64rem; }
.art-mini b { font-size: .64rem; }
.art-nav { margin-top: auto; display: flex; justify-content: space-around; padding: 10px 4px 22px; border-top: 1px solid var(--line); color: var(--ink-3); font-size: 1rem; }
.art-nav i:first-child { color: var(--brand); }

/* Transaction cards stacked beside the phone, fading out */
.art-list {
  position: absolute; z-index: 2; left: 7%; top: 50%; transform: translateY(-38%);
  width: min(330px, 46%); display: grid; gap: 10px;
}
.art-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 14px;
  background: color-mix(in srgb, var(--surface) 92%, transparent);
  backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px);
  box-shadow: 0 10px 30px -18px color-mix(in srgb, var(--brand-900) 35%, transparent);
  font-size: .82rem;
}
.art-row:nth-child(1) { box-shadow: 0 18px 40px -16px color-mix(in srgb, var(--brand-900) 35%, transparent); transform: translateX(10px); }
.art-row:nth-child(2) { opacity: .85; }
.art-row:nth-child(3) { opacity: .65; }
.art-row:nth-child(4) { opacity: .42; }
.art-row:nth-child(5) { opacity: .22; }
.art-ico { width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff; font-size: .9rem; }
.art-ico.in { background: var(--pos); }
.art-ico.out { background: var(--ink); color: var(--bg); }
.art-txt { flex: 1; min-width: 0; display: grid; line-height: 1.3; }
.art-txt strong { font-weight: 600; }
.art-txt span { font-size: .72rem; color: var(--ink-3); }
.art-row b { font-weight: 650; white-space: nowrap; }

@media (max-width: 1100px) {
  .art-phone { width: 250px; margin-left: 36%; }
  .art-list { width: 44%; left: 4%; }
}

/* Phone and small tablet: form only */
@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; padding: calc(24px + env(safe-area-inset-top, 0px)) 20px calc(24px + env(safe-area-inset-bottom, 0px)); }
  .auth-main { padding: 0; gap: 32px; }
  .auth-art { display: none; }
  .auth-box { margin-top: 24px; max-width: none; }
  .auth-actions { margin-top: 28px; }
  .auth-foot { max-width: none; }
}

/* With a photo: phone moves left so it doesn't cover the person, cards sit lower right */
.art-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: 62% 40%; }
.art-scrim { display: none; }
.has-photo .art-scrim {
  display: block; position: absolute; inset: 0;
  background: linear-gradient(90deg, color-mix(in srgb, var(--brand-900) 28%, transparent) 0%, color-mix(in srgb, var(--brand-900) 0%, transparent) 55%), linear-gradient(0deg, color-mix(in srgb, var(--brand-900) 35%, transparent) 0%, color-mix(in srgb, var(--brand-900) 0%, transparent) 35%);
}
.has-photo .art-phone { margin: 0 auto 0 9%; width: 250px; transform: rotate(-3deg); z-index: 1; }
.has-photo .art-list { left: auto; right: 5%; top: auto; bottom: 9%; transform: none; width: min(300px, 44%); gap: 8px; }
.has-photo .art-row:nth-child(1) { transform: none; }
.has-photo .art-row:nth-child(n+4) { display: none; }
.art-credit { position: absolute; z-index: 3; left: 20px; bottom: 14px; margin: 0; font-size: .72rem; color: rgb(255 255 255 / .75); }
.art-credit a { color: inherit; }
.art-panel:not(.has-photo) .art-credit { display: none; }
