/* The sign-in screen (renderAuth in app.js; the showcase on the left is web/login.js).
   One screen that never scrolls: flowing strips of real studio screens in the background, the Foramind Studio logo
   large at the top of the sign-in card on the right, an interactive fan of studio cards on the left (hidden on phones).
   Every class is lg-* so nothing here touches the rest of the studio. */
.lg { position: fixed; inset: 0; overflow: hidden; container: lg / size; background: #f2f4f8; color: var(--ink); }
.lg-screen { position: absolute; inset: 0; display: grid; grid-template-columns: minmax(0, 1fr) clamp(330px, 29cqw, 450px); gap: clamp(16px, 2.5cqw, 48px);
  padding: clamp(10px, 2.2cqh, 28px) clamp(14px, 3cqw, 56px); isolation: isolate; overflow: hidden; }
.lg img { display: block; max-width: 100%; }
.lg-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lg .lg-ic { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }

/* ---- background: the tilted, flowing strips (built after the card, lazily) */
.lg-bg { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.lg-rows { position: absolute; inset: -4% 0; display: flex; flex-direction: column; justify-content: space-around; transform: rotate(-6deg) scale(1.15); }
.lg-row { display: flex; gap: 16px; width: max-content; animation: lgLeft 80s linear infinite; }
.lg-row:nth-child(even) { animation-name: lgRight; animation-duration: 95s; }
.lg-row img { height: clamp(90px, 17cqh, 200px); width: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-12); background: #e6e8ef; box-shadow: 0 10px 24px -12px rgba(20, 22, 58, .35); }
.lg-veil { position: absolute; inset: 0; pointer-events: none; background: rgba(242, 244, 248, .7); backdrop-filter: blur(1.5px); -webkit-backdrop-filter: blur(1.5px);
  -webkit-mask: radial-gradient(280px circle at var(--mx, 30%) var(--my, 40%), transparent 0 38%, #000 100%); mask: radial-gradient(280px circle at var(--mx, 30%) var(--my, 40%), transparent 0 38%, #000 100%); }
@keyframes lgLeft { to { transform: translateX(-50%); } }
@keyframes lgRight { from { transform: translateX(-50%); } to { transform: translateX(0); } }
/* transform only: a paused animation (background tab) must never leave the card invisible */
@keyframes lgRise { from { transform: translateY(12px); } to { transform: none; } }
@keyframes lgSpin { to { transform: rotate(360deg); } }
@keyframes lgShake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
@keyframes lgPop { from { transform: scale(.6); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---- right column: the studio logo over the card (scrolls inside itself only on very short screens) */
.lg-side { display: flex; flex-direction: column; gap: clamp(8px, 1.8cqh, 18px); min-height: 0; overflow-y: auto; scrollbar-width: none;
  padding: 10px 44px 56px; margin: -10px -44px -56px; }   /* room for the card's shadow inside the scroll box */
.lg-side::-webkit-scrollbar { display: none; }
.lg-side > :first-child { margin-top: auto; } .lg-side > :last-child { margin-bottom: auto; }
/* the studio's logo: large, at the top of the card, on the card's own white (no pill), a hairline under it */
.lg-logo { display: flex; justify-content: center; margin: calc(var(--g) * -.2) 0 calc(var(--g) * 1.1); padding-bottom: calc(var(--g) * 1.1); border-bottom: 1px solid rgba(20, 22, 58, .08); }
.lg-logo .brand { display: block; }
.lg-logo .brand img.logo { height: clamp(52px, 10cqh, 92px); width: auto; max-width: 100%; }
.lg-card { position: relative; flex: none; border-radius: clamp(18px, 3cqh, 28px); padding: clamp(14px, 3cqh, 32px) clamp(18px, 2.4cqw, 32px); border: 1.5px solid transparent;
  background: linear-gradient(#fff, #fff) padding-box, linear-gradient(135deg, #2affde, #0a6cf0 30%, var(--violet) 62%, #ff15cb 85%, #ffe16e) border-box;
  box-shadow: 0 2px 6px rgba(20, 22, 58, .06), 0 40px 90px -30px rgba(20, 22, 58, .35); animation: lgRise .6s var(--ease) both .05s;
  --g: clamp(6px, 1.65cqh, 15px); color: var(--ink); }

/* ---- the form */
.lg-badge { display: inline-flex; align-items: center; gap: var(--s-2); padding: 4px 12px 4px var(--s-2); border-radius: var(--r-pill); background: var(--violet-tint); color: var(--violet-ink); font-weight: 600; font-size: clamp(12px, 1.8cqh, 14px); }
.lg-badge img { width: 18px; height: 18px; } .lg-badge svg { width: 15px; height: 15px; }
.lg-title { font: 600 clamp(21px, 4.1cqh, 30px)/1.08 var(--display); letter-spacing: -.03em; margin: calc(var(--g) * .8) 0 0; color: var(--ink); }
.lg-logo + .lg-title { margin-top: 0; }
.lg-title:focus { outline: none; }
.lg-sub { color: #5f5f6b; margin: 3px 0 0; font-size: clamp(13px, 1.85cqh, 14px); line-height: 1.42; }
.lg-form { display: grid; gap: var(--g); margin-top: var(--g); }
.lg-field { display: grid; gap: clamp(3px, .6cqh, 6px); }
.lg-field > span, .lg-field > label { font-size: clamp(13px, 1.8cqh, 14px); font-weight: 600; color: var(--ink-2); }
.lg-hint2 { font-size: var(--fs-12); color: #5f5f6b; font-weight: 500; }
.lg-in { width: 100%; border: 1.5px solid #dcdce4; background: #fff; color: var(--ink); border-radius: var(--r-12); padding: clamp(7px, 1.4cqh, 12px) 14px; font: var(--fs-16) var(--body); outline: none; transition: border-color .15s, box-shadow .15s; }
.lg-in::placeholder { color: var(--faint); }
.lg-in:hover { border-color: #c5c5d0; }
.lg-in:focus { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(10, 108, 240, .16); }
.lg-pw { position: relative; } .lg-pw .lg-in { padding-right: 48px; }
.lg-eye { position: absolute; right: 4px; top: 50%; transform: translateY(-50%); width: 40px; height: 36px; border: 0; border-radius: var(--r-12); background: transparent; color: #5f5f6b; display: grid; place-items: center; padding: 0; }
.lg-eye:hover { color: var(--ink); }
/* a field's own message under it (the form is novalidate: no browser bubble) */
.lg-ferr { display: flex; align-items: center; gap: 6px; color: #b42318; font-size: var(--fs-13); font-weight: 600; line-height: 1.3; }
.lg-ferr:empty { display: none; }
.lg-ferr::before { content: '!'; flex: none; display: grid; place-items: center; width: 16px; height: 16px; border-radius: 50%; background: #d92d20; color: #fff; font-size: var(--fs-12); font-weight: 800; }
.lg-in[aria-invalid="true"] { border-color: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .12); }
.lg-in[aria-invalid="true"]:focus { border-color: #d92d20; box-shadow: 0 0 0 4px rgba(217, 45, 32, .18); }
.lg-err:empty { display: none; }
.lg-err { background: var(--danger-tint); color: #b42318; padding: 8px 12px; border-radius: var(--r-12); font-size: var(--fs-14); font-weight: 500; }
.lg-err a { color: inherit; font-weight: 700; text-decoration: underline; }
.lg-btn { display: inline-flex; justify-content: center; align-items: center; gap: var(--s-2); width: 100%; border: 0; border-radius: var(--r-pill); padding: clamp(9px, 1.7cqh, 14px) 18px; font: 700 clamp(15px, 2.1cqh, 16px) var(--body); background: var(--cta); color: #fff; transition: transform .2s var(--ease), box-shadow .2s; }
.lg-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 26px rgba(123, 63, 228, .3); }
.lg-btn:disabled { cursor: progress; opacity: .85; transform: none; }
.lg-btn .lg-ic { transition: transform .2s var(--ease); } .lg-btn:hover .lg-ic { transform: translateX(3px); }
.lg-spin { width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid currentColor; border-right-color: transparent; animation: lgSpin .8s linear infinite; flex: none; }
.lg-reg { margin-top: var(--g); padding-top: var(--g); border-top: 1px solid rgba(20, 22, 58, .09); display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
.lg-reg > span { font-weight: 600; font-size: clamp(13px, 1.8cqh, 14px); color: var(--ink-2); }
.lg-ghost { display: inline-flex; align-items: center; gap: var(--s-2); padding: clamp(4px, .85cqh, 8px) 13px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1.5px var(--line-2); color: var(--ink); font-weight: 600; font-size: var(--fs-14); text-decoration: none; }
.lg-ghost:hover { box-shadow: inset 0 0 0 1.5px var(--ink); } .lg-ghost .lg-ic { width: 15px; height: 15px; }
.lg-reg small { flex-basis: 100%; color: #5f5f6b; font-size: var(--fs-13); line-height: 1.38; }
.lg-foot { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-top: var(--g); flex-wrap: wrap; }
.lg-admin { display: inline-flex; align-items: center; gap: 6px; color: var(--accent-deep); font-weight: 600; font-size: var(--fs-14); text-decoration: none; }
.lg-admin:hover { text-decoration: underline; } .lg-admin svg { width: 15px; height: 15px; }
/* "Beni hatırla" and "Şifremi unuttum" under the password */
.lg-opts { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: -2px; }
.lg-remember { display: inline-flex; align-items: center; gap: 8px; font-size: var(--fs-14); color: var(--ink-3, #3b3b4a); cursor: pointer; }
.lg-remember input { width: 18px; height: 18px; margin: 0; accent-color: var(--accent, #0a6cf0); cursor: pointer; }
.lg-remember input:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a6cf0; border-radius: 4px; }
.lg-forgot { color: var(--accent-deep, #0752b8); font-weight: 600; font-size: var(--fs-14); text-decoration: none; }
.lg-forgot:hover { text-decoration: underline; }
.lg-forgot:focus-visible { outline: none; box-shadow: 0 0 0 2px #fff, 0 0 0 4px #0a6cf0; border-radius: 4px; }
.lg-lang { display: inline-flex; padding: 3px; border-radius: var(--r-pill); background: rgba(20, 22, 58, .06); }
.lg-lang button { border: 0; background: transparent; color: #5f5f6b; font-weight: 700; font-size: var(--fs-12); padding: 4px 10px; border-radius: var(--r-pill); }
.lg-lang button[aria-pressed="true"] { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0, 0, 0, .14); }
.lg :focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }
.lg .lg-in:focus-visible { outline: none; }
@container lg (max-height: 640px) { .lg-sub { font-size: var(--fs-13); } .lg-reg small { font-size: var(--fs-12); } }

/* ---- left: the interactive fan of real screens (web/login.js) */
.lg-left { position: relative; min-width: 0; min-height: 0; }
.lg-fan { position: absolute; left: 50%; top: 54%; width: 0; height: 0; }
.lg-dc { --w: clamp(260px, min(30cqw, 58cqh), 600px); position: absolute; left: calc(var(--w) / -2); top: 0; width: var(--w); border-radius: var(--r-18); background: #fff; overflow: hidden;
  box-shadow: 0 2px 6px rgba(20, 22, 58, .08), 0 30px 60px -26px rgba(20, 22, 58, .45); transform-origin: 50% 100%;
  transform: translate(var(--x, 0px), calc(-50% + var(--y, 0px))) rotate(var(--r, 0deg)) scale(var(--s, 1)); transition: transform .6s var(--ease), box-shadow .3s; z-index: var(--z, 1); }
.lg-dc.front { box-shadow: 0 2px 6px rgba(20, 22, 58, .08), 0 40px 80px -24px rgba(20, 22, 58, .55), 0 0 0 2px rgba(123, 63, 228, .35); }
.lg-dc-h { display: flex; align-items: center; gap: 8px; padding: var(--s-2) 10px; border-bottom: 1px solid #ececf2; background: #fafafc; font-weight: 700; font-size: var(--fs-13); color: var(--ink-2); height: 38px; }
.lg-dc-h img { width: 22px; height: 22px; }
.lg-dots { display: flex; gap: var(--s-1); margin-right: 4px; } .lg-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.lg-dc-h .lg-r { margin-left: auto; display: flex; gap: 4px; }
.lg-dc-v { position: relative; aspect-ratio: 16 / 10; background: #f4f5f9; overflow: hidden; }
.lg-dc-v > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: top left; transition: opacity .5s ease; }
.lg-dc-v > img.off { opacity: 0; }
.lg-mini { border: 0; background: #fff; box-shadow: 0 0 0 1px var(--line); border-radius: var(--r-pill); padding: 3px 10px; font-size: var(--fs-12); font-weight: 700; color: var(--ink-3); }
button.lg-mini:hover { box-shadow: 0 0 0 1px var(--ink-3); }
.lg-mini[aria-selected="true"] { background: var(--accent); color: #fff; box-shadow: none; }
.lg-ov { position: absolute; z-index: 2; }
.lg-bar { left: 10px; right: 10px; bottom: 10px; display: flex; align-items: center; gap: 8px; background: rgba(255, 255, 255, .94); border-radius: var(--r-pill); padding: var(--s-1) 6px var(--s-1) 12px; box-shadow: 0 6px 18px rgba(20, 22, 58, .18); font-size: var(--fs-13); font-weight: 600; }
.lg-bar .lg-t { flex: 1; min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lg-rb { width: 28px; height: 28px; border-radius: 50%; border: 0; display: grid; place-items: center; background: var(--cta); color: #fff; flex: none; padding: 0; }
.lg-rb.g { background: #eef0f6; color: var(--ink); }
.lg-rb .lg-ic { width: 14px; height: 14px; }
.lg-ans { left: 8px; right: 8px; bottom: 8px; display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.lg-ans[hidden] { display: none; }
.lg-ans button { border: 0; border-radius: var(--r-12); padding: var(--s-2) var(--s-2); color: #fff; font-weight: 700; font-size: var(--fs-13); display: flex; gap: 6px; align-items: center; box-shadow: 0 3px 0 rgba(0, 0, 0, .2); text-align: left; }
.lg-ans button svg { width: 14px; height: 14px; fill: currentColor; flex: none; }
.lg-ans .a0 { background: #e21b3c; } .lg-ans .a1 { background: #1368ce; } .lg-ans .a2 { background: #d89e00; } .lg-ans .a3 { background: #26890c; }
.lg-ans button.right { box-shadow: 0 0 0 3px #fff, 0 0 0 5px #26890c; animation: lgPop .3s var(--ease); }
.lg-ans button.wrong { opacity: .45; animation: lgShake .4s; }
.lg-ans button:disabled { cursor: default; }
.lg-toast { left: 50%; top: 12px; transform: translateX(-50%); background: #fff; border-radius: var(--r-pill); padding: var(--s-1) 12px; font-weight: 800; font-size: var(--fs-13); box-shadow: 0 8px 20px rgba(20, 22, 58, .22); white-space: nowrap; animation: lgPop .35s var(--ease); }
.lg-toast[hidden] { display: none; }
.lg-chips { left: 8px; right: 8px; bottom: 8px; display: flex; gap: 8px; justify-content: center; }
.lg-chips button { border: 0; background: #fff; border-radius: var(--r-12); padding: 4px; display: grid; gap: 2px; justify-items: center; font-size: var(--fs-12); font-weight: 700; box-shadow: 0 6px 16px rgba(20, 22, 58, .22); transition: transform .3s var(--ease); width: 84px; line-height: 1.15; text-align: center; }
.lg-chips img { width: 62px; height: 50px; object-fit: contain; }
.lg-chips button:hover { transform: translateY(-4px); }
.lg-chips button.placed { transform: translateY(-6px); box-shadow: 0 0 0 2.5px #26890c, 0 6px 16px rgba(20, 22, 58, .22); }
.lg-chips button.miss { animation: lgShake .4s; }
.lg-q { left: 10px; top: 10px; background: rgba(20, 22, 58, .86); color: #fff; padding: 4px var(--s-3); border-radius: var(--r-pill); font-size: var(--fs-12); font-weight: 700; }
.lg-flash { perspective: 900px; }
.lg-fc { position: absolute; inset: 12px 12px 48px; transform-style: preserve-3d; transition: transform .7s var(--ease); cursor: pointer; border: 0; padding: 0; background: transparent; }
.lg-fc.flip { transform: rotateY(180deg); }
.lg-fc > div { position: absolute; inset: 0; border-radius: var(--r-12); backface-visibility: hidden; -webkit-backface-visibility: hidden; overflow: hidden; display: grid; box-shadow: 0 10px 24px -10px rgba(20, 22, 58, .4); }
.lg-fc .fr { background: #fff; grid-template-rows: 1fr auto; }
/* the node's own transparent picture on a soft panel, whole (as the studio's study card shows it) */
.lg-fc .fr img { width: calc(100% - 16px); height: calc(100% - 8px); margin: 8px 8px 0; padding: 3% 6%; box-sizing: border-box; object-fit: contain; min-height: 0; border-radius: 10px; background: #f3f4f8; }
.lg-fc .fr b { padding: var(--s-2) 10px; font-size: var(--fs-13); text-align: center; }
.lg-fc .bk { transform: rotateY(180deg); background: linear-gradient(135deg, var(--violet-tint), var(--blue-tint)); place-content: center; text-align: center; padding: 14px; }
.lg-fc .bk b { font: 600 clamp(18px, 2.4cqw, 28px) var(--display); color: var(--violet-ink); }
.lg-fc .bk span { font-size: var(--fs-14); color: var(--ink-2); margin-top: 6px; }
.lg-hint { position: absolute; left: 0; top: clamp(4px, 1.6cqh, 16px); margin: 0; display: inline-flex; gap: 8px; align-items: center; background: rgba(255, 255, 255, .9); padding: 6px var(--s-3); border-radius: var(--r-pill); font-size: var(--fs-13); font-weight: 600; color: var(--ink-3); box-shadow: 0 0 0 1px var(--line); z-index: 30; }
.lg-hint b { color: var(--violet-ink); }
.lg-left:not(.on) .lg-hint { display: none; }
@container lg (max-height: 700px) { .lg-hint { display: none; } }

/* phones / narrow: the fan goes, the card is centred */
@container lg (max-width: 820px) {
  .lg-screen { grid-template-columns: minmax(0, 1fr); justify-items: center; padding: 12px; }
  .lg-left { display: none; }
  .lg-side { width: calc(min(420px, 100%) + 88px); }
  .lg-logo .brand img.logo { height: clamp(44px, 8cqh, 72px); }
}
@media (prefers-reduced-motion: reduce) {
  .lg *, .lg *::before, .lg *::after { animation-duration: .001s !important; animation-iteration-count: 1 !important; transition-duration: .001s !important; }
}
