:root {
  color-scheme: dark;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #0c0f13;
  color: #f1f5f8;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  background:
    radial-gradient(ellipse at 70% 8%, rgba(0,163,255,.16), transparent 42%),
    radial-gradient(ellipse at 0% 100%, rgba(95,83,180,.12), transparent 38%),
    #0c0f13;
}

a { color: #8bd1ff; text-decoration: none; }
a:hover { color: white; }

.auth-shell {
  width: min(100% - 32px, 430px);
  margin: 0 auto;
  padding: clamp(36px, 9vh, 84px) 0 42px;
}

.auth-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 30px;
  color: #edf5fb;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
}

.auth-brand img { display: block; width: 40px; height: 28px; object-fit: contain; }

.auth-brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 11px;
  color: #07131d;
  background: #00a3ff;
  font-size: 19px;
  letter-spacing: 0;
}

.auth-card {
  padding: clamp(24px, 6vw, 36px);
  border: 1px solid rgba(255,255,255,.1);
  border-radius: 24px;
  background: rgba(23,28,35,.76);
  box-shadow: 0 28px 90px rgba(0,0,0,.34), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(26px);
}

.auth-card h1 { margin: 0; font-size: clamp(27px, 7vw, 35px); letter-spacing: -.04em; }
.auth-card > p { margin: 10px 0 25px; color: #9ba8b5; font-size: 14px; line-height: 1.6; }
.auth-form { display: grid; gap: 15px; }
.auth-field { display: grid; gap: 7px; color: #cad4de; font-size: 12px; }
.auth-field input, .auth-field textarea, .auth-field select {
  width: 100%;
  min-height: 46px;
  padding: 11px 13px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  outline: 0;
  color: #f3f6f9;
  background: rgba(255,255,255,.045);
  font: inherit;
}
.auth-field textarea { min-height: 100px; resize: vertical; }
.auth-field input:focus, .auth-field textarea:focus, .auth-field select:focus { border-color: #00a3ff; box-shadow: 0 0 0 3px rgba(0,163,255,.13); }
.auth-field select { cursor: pointer; }
.auth-primary, .auth-provider, .auth-secondary {
  display: inline-flex;
  min-height: 46px;
  align-items: center;
  justify-content: center;
  gap: 9px;
  padding: 11px 14px;
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 12px;
  color: #f4f8fc;
  background: rgba(255,255,255,.055);
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s ease, transform .18s ease, border-color .18s ease;
}
.auth-primary { border-color: transparent; color: #05131e; background: #00a3ff; }
.auth-primary:hover, .auth-provider:hover, .auth-secondary:hover { transform: translateY(-1px); }
.auth-primary:hover { background: #42b6ff; }
.auth-provider:hover, .auth-secondary:hover { border-color: rgba(255,255,255,.25); background: rgba(255,255,255,.09); }
.auth-provider:disabled, .auth-primary:disabled { opacity: .58; cursor: wait; transform: none; }
.auth-divider { display: flex; align-items: center; gap: 12px; margin: 19px 0; color: #778492; font-size: 11px; }
.auth-divider::before, .auth-divider::after { height: 1px; flex: 1; background: rgba(255,255,255,.1); content: ""; }
.auth-social { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 9px; }
.auth-social .auth-provider[hidden] { display: none; }
.auth-social:has(.auth-provider[hidden]) { grid-template-columns: 1fr; }
.auth-message { margin: 14px 0 0; color: #8bd1ff; font-size: 12px; line-height: 1.6; overflow-wrap: anywhere; }
.auth-message.is-error { color: #ff9eaa; }
.auth-message[hidden] { display: none; }
.auth-links { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 11px; margin-top: 20px; color: #a9b5c1; font-size: 12px; }
.auth-foot { margin-top: 20px; color: #788491; font-size: 11px; line-height: 1.6; text-align: center; }
.auth-profile-top { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 20px; }
.auth-profile-top .auth-brand { margin: 0; }
.auth-profile-links { display: flex; flex-wrap: wrap; gap: 9px; }
.profile-email { overflow-wrap: anywhere; color: #96a4b2; font-size: 12px; }
.auth-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 20px; }
.artist-studio-entry { display: grid; gap: 10px; margin-top: 19px; padding-top: 17px; border-top: 1px solid rgba(255,255,255,.1); color: #a9b5c1; font-size: 12px; }
.artist-studio-entry[hidden] { display: none; }
.artist-studio-entry .auth-primary { width: 100%; }

.auth-shell > .auth-brand { margin-bottom: 22px; }
.auth-card { border-radius: 20px; }
.auth-card h1 { margin-bottom: 22px; }
.auth-divider { margin: 20px 0 15px; }

@media (max-width: 420px) {
  .auth-social { grid-template-columns: 1fr; }
  .auth-links { flex-direction: column; }
}

button:not(:disabled), [role="button"], [role="tab"], summary,
select:not(:disabled), input[type="range"]:not(:disabled),
input[type="checkbox"]:not(:disabled), input[type="radio"]:not(:disabled),
input[type="color"]:not(:disabled) { cursor: pointer; }

.auth-consent { display: flex; align-items: flex-start; gap: 10px; color: #aab4c1; font-size: 12px; line-height: 1.5; cursor: pointer; }
.auth-consent input { flex: 0 0 auto; width: 18px; height: 18px; margin: 1px 0 0; accent-color: #7cc7ff; }
.auth-consent a, .auth-legal a { color: inherit; text-decoration: underline; text-underline-offset: 2px; }

.danger-zone { margin-top: 26px; padding: 16px; border: 1px solid rgba(255,92,108,.32); border-radius: 12px; background: rgba(255,92,108,.05); }
.danger-zone h2 { margin: 0 0 6px; font-size: 14px; color: #ff9eaa; }
.danger-zone p { margin: 0 0 12px; color: #a9b5c1; font-size: 12px; line-height: 1.6; }
.auth-danger { min-height: 44px; padding: 10px 16px; border: 1px solid rgba(255,92,108,.5); border-radius: 12px; background: transparent; color: #ff9eaa; font: inherit; font-weight: 600; cursor: pointer; }
.auth-danger:hover:not(:disabled) { background: rgba(255,92,108,.14); }
.auth-danger:disabled { opacity: .55; cursor: wait; }

.auth-lang { display: flex; justify-content: flex-end; margin-bottom: 14px; }
.auth-lang select,
.qr-top select {
  padding: 8px 12px;
  border: 1px solid rgba(255,255,255,.12);
  border-radius: 12px;
  color: #edf5fb;
  background: rgba(255,255,255,.05);
  font: inherit;
  font-size: 13px;
}
.auth-lang select option,
.qr-top select option { color: #111; }

.auth-qr-toggle { width: 100%; margin-top: 12px; }
.auth-qr-toggle[hidden], .auth-qr[hidden] { display: none; }
.auth-qr { display: grid; gap: 12px; margin-top: 16px; padding-top: 16px; border-top: 1px solid rgba(255,255,255,.1); text-align: center; }
.auth-qr h2 { margin: 0; font-size: 15px; font-weight: 650; }
.auth-qr-help { margin: 0; color: #a9b5c1; font-size: 12px; line-height: 1.6; }
.auth-qr-box { justify-self: center; width: 220px; height: 220px; padding: 0; border-radius: 14px; background: #fff; overflow: hidden; }
.auth-qr-box img { display: block; width: 100%; height: 100%; }
.auth-qr-code { display: grid; gap: 4px; color: #a9b5c1; font-size: 12px; }
.auth-qr-code strong { color: var(--auth-text, #f4f8fc); font-size: 30px; font-weight: 700; letter-spacing: .32em; text-indent: .32em; font-variant-numeric: tabular-nums; }
.auth-qr-status { margin: 0; color: #8bd1ff; font-size: 12px; }
.auth-qr-status.is-error { color: #ff9eaa; }
.auth-qr-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 9px; }
.auth-qr-input { text-align: center; font-size: 24px; letter-spacing: .4em; text-indent: .4em; font-variant-numeric: tabular-nums; }

/* ---- QR approval: full-page confirmation screen (phone) */
body.qr-page { margin: 0; min-height: 100vh; min-height: 100dvh; background: radial-gradient(120% 70% at 50% 0%, color-mix(in srgb, var(--auth-accent, #00a3ff) 16%, #0c0f13) 0%, #0c0f13 62%); }
.qr-shell { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; padding: max(18px, env(safe-area-inset-top)) 22px max(24px, env(safe-area-inset-bottom)); box-sizing: border-box; }
.qr-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.qr-top .auth-brand { margin: 0; }
.qr-stage { flex: 1; width: 100%; max-width: 420px; margin: 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; text-align: center; padding: 18px 0 8px; }
.qr-stage[hidden] { display: none; }
.qr-stage h1 { margin: 4px 0 0; font-size: clamp(26px, 7vw, 32px); font-weight: 680; letter-spacing: -.03em; }
.qr-icon { display: grid; place-items: center; width: 76px; height: 76px; border-radius: 24px; color: var(--auth-accent, #00a3ff); background: color-mix(in srgb, var(--auth-accent, #00a3ff) 14%, transparent); border: 1px solid color-mix(in srgb, var(--auth-accent, #00a3ff) 32%, transparent); }
.qr-icon svg { width: 38px; height: 38px; }
.qr-lead { margin: 0; max-width: 340px; color: #a9b5c1; font-size: 14px; line-height: 1.6; }
.qr-device { display: grid; gap: 3px; width: 100%; padding: 12px 16px; border: 1px solid rgba(255,255,255,.1); border-radius: 14px; background: rgba(255,255,255,.04); }
.qr-device span { color: #8896a5; font-size: 11px; letter-spacing: .06em; text-transform: uppercase; }
.qr-device strong { font-size: 15px; font-weight: 640; }
.qr-label { margin: 10px 0 0; color: #c3ceda; font-size: 13px; line-height: 1.5; }
.qr-digits { display: flex; justify-content: center; gap: 12px; }
.qr-digit { width: 62px; height: 78px; padding: 0; border: 1.5px solid rgba(255,255,255,.16); border-radius: 16px; color: var(--auth-text, #f4f8fc); background: rgba(255,255,255,.05); font: 600 34px/1 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-variant-numeric: tabular-nums; text-align: center; caret-color: var(--auth-accent, #00a3ff); outline: none; transition: border-color .15s ease, background .15s ease, transform .15s ease; }
.qr-digit:focus { border-color: var(--auth-accent, #00a3ff); background: color-mix(in srgb, var(--auth-accent, #00a3ff) 10%, transparent); transform: translateY(-2px); }
.qr-digits.is-busy .qr-digit { opacity: .6; }
.qr-digits.is-shake { animation: qr-shake .38s ease; }
@keyframes qr-shake { 20% { transform: translateX(-8px); } 40% { transform: translateX(8px); } 60% { transform: translateX(-5px); } 80% { transform: translateX(5px); } }
.qr-feedback { min-height: 20px; margin: 0; color: #8bd1ff; font-size: 13px; }
.qr-feedback.is-error { color: #ff9eaa; }
.qr-deny { margin-top: 6px; padding: 12px 18px; border: 0; border-radius: 12px; color: #aab6c3; background: transparent; font: inherit; font-size: 14px; cursor: pointer; }
.qr-deny:hover { color: #fff; background: rgba(255,255,255,.07); }
.qr-result-icon { width: 92px; height: 92px; border-radius: 30px; }
.qr-result-icon svg { width: 48px; height: 48px; }
.qr-stage[data-kind="problem"] .qr-icon { color: #ff9eaa; background: rgba(255,107,125,.12); border-color: rgba(255,107,125,.32); }
.qr-open { margin-top: 10px; width: 100%; max-width: 320px; text-decoration: none; }
@media (max-width: 380px) { .qr-digit { width: 54px; height: 68px; font-size: 30px; } .qr-digits { gap: 9px; } }
@media (prefers-reduced-motion: reduce) { .qr-digits.is-shake { animation: none; } .qr-digit { transition: none; } }

