/* Playable Studio — strona logowania. Te same tokeny co studio (styles.css), osobny plik: strona ma ścisłe CSP. */
:root {
  color-scheme: light;
  --bg: #efede8;
  --panel: #fcfbf9;
  --panel-2: #f3f1ec;
  --panel-3: #e9e6df;
  --line: #e6e2da;
  --line-2: #d6d1c6;
  --text: #24221e;
  --muted: #7b766c;
  --accent: #f2603a;
  --accent-hover: #e2522d;
  --accent-text: #ffffff;
  --accent-soft: #f2603a1a;
  --accent-ink: #b8401f;
  --focus: #4a78ff;
  --focus-soft: #4a78ff2e;
  --danger: #c43d27;
  --danger-bg: #fbe9e5;
  --ok-bg: #eff8f2; --ok-line: #cfe9d8; --ok-text: #24603f;
  --canvas: #e6e3dc;
  --canvas-dot: #d2cdc2;
  --phone: #1d1c1a;
  --shadow-lg: 0 2px 6px #2a262012, 0 24px 60px #2a262026;
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #121110; --panel: #1b1a18; --panel-2: #242320; --panel-3: #2d2b27;
  --line: #2b2925; --line-2: #3a3732; --text: #f2efe9; --muted: #a49f95;
  --accent: #ff7348; --accent-hover: #ff865f; --accent-text: #1a0d07; --accent-soft: #ff734826; --accent-ink: #ffa07f;
  --focus: #7d9dff; --focus-soft: #7d9dff33; --danger: #ff7d68; --danger-bg: #3a1d17;
  --ok-bg: #142219; --ok-line: #23402e; --ok-text: #8fdcae;
  --canvas: #0e0d0c; --canvas-dot: #24221f; --phone: #050505;
  --shadow-lg: 0 2px 6px #00000050, 0 24px 60px #00000080;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #121110; --panel: #1b1a18; --panel-2: #242320; --panel-3: #2d2b27;
    --line: #2b2925; --line-2: #3a3732; --text: #f2efe9; --muted: #a49f95;
    --accent: #ff7348; --accent-hover: #ff865f; --accent-text: #1a0d07; --accent-soft: #ff734826; --accent-ink: #ffa07f;
    --focus: #7d9dff; --focus-soft: #7d9dff33; --danger: #ff7d68; --danger-bg: #3a1d17;
    --ok-bg: #142219; --ok-line: #23402e; --ok-text: #8fdcae;
    --canvas: #0e0d0c; --canvas-dot: #24221f; --phone: #050505;
    --shadow-lg: 0 2px 6px #00000050, 0 24px 60px #00000080;
  }
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; background: var(--bg); color: var(--text); }
body { font: 14px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", Inter, "Segoe UI", Roboto, sans-serif; -webkit-font-smoothing: antialiased; letter-spacing: -.005em; }
.hidden { display: none !important; }
.muted { color: var(--muted); }
button, input { font: inherit; color: inherit; }

.auth { min-height: 100vh; min-height: 100dvh; display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(380px, 1fr); }

/* ---------- lewa strona: płótno studia ---------- */
.stage {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 28px;
  padding: 40px; overflow: hidden;
  background-color: var(--canvas);
  background-image: radial-gradient(var(--canvas-dot) 1px, transparent 1.2px);
  background-size: 18px 18px;
}
.brand { display: flex; align-items: center; gap: 10px; font-size: 15px; letter-spacing: -.01em; }
.brand img { filter: drop-shadow(0 3px 8px #e9472c40); }
.stage > .brand { position: absolute; top: 28px; left: 32px; }
.stage-note { position: absolute; left: 32px; bottom: 26px; margin: 0; font-size: 13px; color: var(--text); opacity: .85; line-height: 1.55; }
.stage-note span { color: var(--muted); }

.demo { display: flex; flex-direction: column; align-items: center; gap: 18px; }
.phone {
  position: relative; width: 236px; height: 470px; border-radius: 36px; padding: 18px 14px 16px;
  background: #2b2440; box-shadow: 0 0 0 9px var(--phone), var(--shadow-lg);
  display: flex; flex-direction: column; gap: 14px;
}
.ph-top { display: flex; justify-content: space-between; align-items: center; color: #fff; font-size: 12px; font-weight: 650; padding: 4px 4px 0; }
.ph-lvl { background: #ffffff1f; border-radius: 99px; padding: 3px 10px; }
.ph-score::before { content: ""; display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: #f3c56b; margin-right: 6px; vertical-align: 0; }
.board { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; padding: 10px; border-radius: 18px; background: #ffffff12; }
.t { aspect-ratio: 1; border-radius: 11px; display: block; box-shadow: inset 0 -4px 0 #00000026; }
.t.a { background: #f2603a; }
.t.b { background: #f3c56b; }
.t.c { background: #6fae8f; }
.t.d { background: #6f8fe0; }
.t.hit { background: #f3c56b; animation: hit 6s infinite; }
.goal { display: flex; align-items: center; gap: 10px; padding: 0 6px; color: #ffffffb3; font-size: 11px; font-weight: 650; }
.goal-bar { flex: 1; height: 8px; border-radius: 99px; background: #ffffff1f; overflow: hidden; }
.goal-bar i { display: block; height: 100%; width: 33%; border-radius: inherit; background: #f3c56b; animation: goal 6s infinite; }
@keyframes goal { 0%, 30% { width: 33%; } 38%, 100% { width: 66%; } }
.ph-cta {
  margin-top: auto; align-self: center; padding: 11px 26px; border-radius: 99px; background: #3ecf7c; color: #0c2a18;
  font-weight: 800; font-size: 14px; letter-spacing: .01em; box-shadow: inset 0 -3px 0 #00000026; animation: cta 6s infinite;
}
.hand { position: absolute; left: 0; top: 0; filter: drop-shadow(0 4px 6px #0006); animation: hand 6s infinite; transform-origin: 12px 4px; }

.tl { position: relative; display: flex; gap: 6px; padding: 6px; border-radius: 12px; background: var(--panel); box-shadow: 0 1px 2px #2a26200a, 0 8px 24px #2a26200f; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px 5px 6px; border-radius: 8px; font-size: 12px; color: var(--muted); background: var(--panel-2); }
.chip b { display: inline-grid; place-items: center; width: 18px; height: 18px; border-radius: 6px; background: var(--panel-3); color: var(--text); font-size: 10px; }
.chip:nth-child(1) { animation: chip1 6s infinite; }
.chip:nth-child(2) { animation: chip2 6s infinite; }
.chip:nth-child(3) { animation: chip3 6s infinite; }
.playhead { position: absolute; top: -4px; bottom: -4px; left: 6px; width: 2px; border-radius: 2px; background: var(--accent); animation: playhead 6s linear infinite; }
.playhead::before { content: ""; position: absolute; top: -3px; left: -4px; width: 10px; height: 6px; border-radius: 3px; background: var(--accent); }

/* scenariusz pętli 6 s: ręka stuka w rząd, rząd znika, reklama przechodzi do CTA */
@keyframes hand {
  0%   { transform: translate(196px, 330px) scale(1); opacity: 0; }
  8%   { opacity: 1; }
  20%  { transform: translate(131px, 128px) scale(1); }
  24%  { transform: translate(131px, 128px) scale(.86); }
  28%  { transform: translate(131px, 128px) scale(1); }
  52%  { transform: translate(131px, 128px) scale(1); }
  66%  { transform: translate(112px, 424px) scale(1); }
  70%  { transform: translate(112px, 424px) scale(.86); }
  74%  { transform: translate(112px, 424px) scale(1); opacity: 1; }
  90%  { transform: translate(112px, 424px) scale(1); opacity: 0; }
  100% { transform: translate(196px, 330px) scale(1); opacity: 0; }
}
@keyframes hit {
  0%, 24% { transform: scale(1); opacity: 1; filter: none; }
  28% { transform: scale(1.12); filter: brightness(1.25); }
  36% { transform: scale(0); opacity: 0; }
  46% { transform: scale(0); opacity: 0; background: #6f8fe0; }
  54%, 100% { transform: scale(1); opacity: 1; background: #6f8fe0; }
}
@keyframes cta {
  0%, 60% { transform: scale(1); }
  64% { transform: scale(1.08); }
  68% { transform: scale(1); }
  70% { transform: scale(.94); }
  76%, 100% { transform: scale(1); }
}
@keyframes playhead { from { left: 6px; } to { left: calc(100% - 8px); } }
@keyframes chip1 { 0%, 30% { background: var(--accent-soft); color: var(--accent-ink); } 34%, 100% { background: var(--panel-2); color: var(--muted); } }
@keyframes chip2 { 0%, 32% { background: var(--panel-2); color: var(--muted); } 34%, 62% { background: var(--accent-soft); color: var(--accent-ink); } 66%, 100% { background: var(--panel-2); color: var(--muted); } }
@keyframes chip3 { 0%, 64% { background: var(--panel-2); color: var(--muted); } 66%, 100% { background: var(--accent-soft); color: var(--accent-ink); } }

/* ---------- prawa strona: formularz ---------- */
.panel { display: flex; flex-direction: column; background: var(--panel); border-left: 1px solid var(--line); padding: 24px 32px 32px; }
.panel-top { display: flex; justify-content: flex-end; align-items: center; min-height: 32px; }
.brand-sm { display: none; margin-right: auto; font-size: 14px; }
.lang { display: inline-flex; padding: 3px; gap: 2px; border-radius: 9px; background: var(--panel-2); }
.lang button { border: 0; background: transparent; padding: 4px 10px; border-radius: 7px; font-size: 12px; font-weight: 650; color: var(--muted); cursor: pointer; }
.lang button.on { background: var(--panel); color: var(--text); box-shadow: 0 1px 2px #0000001f; }

.card { width: 100%; max-width: 370px; margin: auto; padding: 24px 0; display: flex; flex-direction: column; }
.eyebrow { margin: 0 0 10px; font-size: 11px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--accent-ink); }
h1 { margin: 0; font-size: 28px; line-height: 1.15; letter-spacing: -.025em; font-weight: 750; }
.lead { margin: 8px 0 24px; color: var(--muted); }

.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 16px; }
.label { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; font-size: 13px; font-weight: 600; }
.hint { font-weight: 400; font-size: 12px; color: var(--muted); }
input[type=email], input[type=password], input[type=text] {
  width: 100%; height: 44px; padding: 0 13px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--panel);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
input[type=email]:hover, input[type=password]:hover, input[type=text]:hover { border-color: var(--muted); }
input:focus-visible, input[type=email]:focus, input[type=password]:focus, input[type=text]:focus { border-color: var(--focus); box-shadow: 0 0 0 3px var(--focus-soft); }
.code-wrap { position: relative; display: block; }
#code { padding-right: 46px; font-weight: 650; letter-spacing: .3em; text-transform: uppercase; }
#code::placeholder { letter-spacing: normal; }
.eye { position: absolute; right: 5px; top: 5px; width: 34px; height: 34px; border: 0; border-radius: 8px; background: transparent; color: var(--muted); display: grid; place-items: center; cursor: pointer; }
.eye:hover { background: var(--panel-2); color: var(--text); }
.eye:focus-visible, .lang button:focus-visible, .submit:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; }
.eye .eye-off, .eye[aria-pressed="true"] .eye-on { display: none; }
.eye[aria-pressed="true"] .eye-off { display: block; }

.remember { display: flex; align-items: center; gap: 9px; margin: 2px 0 18px; font-size: 13px; user-select: none; }
.remember label { cursor: pointer; }
.remember input { width: 16px; height: 16px; margin: 0; accent-color: var(--accent); }

.notice { margin: 0 0 18px; padding: 10px 12px; border-radius: 10px; background: var(--ok-bg); border: 1px solid var(--ok-line); color: var(--ok-text); font-size: 13px; }
.error { display: flex; gap: 8px; align-items: flex-start; margin: 0 0 14px; padding: 10px 12px; border-radius: 10px; background: var(--danger-bg); color: var(--danger); font-size: 13px; line-height: 1.4; }
.error svg { flex: none; margin-top: 1px; }
.card.shake { animation: shake .36s; }
@keyframes shake { 20%, 60% { transform: translateX(-6px); } 40%, 80% { transform: translateX(6px); } }

.submit {
  height: 46px; border: 0; border-radius: 11px; background: var(--accent); color: var(--accent-text); font-weight: 650; font-size: 15px;
  cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 10px; transition: background .15s, transform .05s;
}
.submit:hover { background: var(--accent-hover); }
.submit:active { transform: translateY(1px); }
.submit[disabled] { opacity: .7; cursor: default; }
.spinner { display: none; width: 16px; height: 16px; border-radius: 50%; border: 2px solid currentColor; border-right-color: transparent; animation: spin .7s linear infinite; }
.submit.busy .spinner { display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

.foot { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--line); font-size: 12px; display: flex; flex-direction: column; gap: 6px; }
.foot p { margin: 0; }
.secure { display: flex; gap: 8px; align-items: flex-start; color: var(--muted); }
.secure svg { flex: none; margin-top: 2px; }

/* ---------- telefon / wąskie okno ---------- */
@media (max-width: 900px) {
  .auth { grid-template-columns: 1fr; }
  .stage { display: none; }
  .panel { border-left: 0; padding: 16px 16px 28px; min-height: 100vh; min-height: 100dvh; }
  .brand-sm { display: flex; }
  .card { margin: 6vh auto auto; }
}
@media (prefers-reduced-motion: reduce) {
  .hand, .t.hit, .ph-cta, .chip, .playhead, .card.shake { animation: none !important; }
  .hand { transform: translate(131px, 128px); }
  .goal-bar i { animation: none; }
}
