/* GeroDocument 로그인·회원가입·비밀번호 찾기/재설정 (auth.html)
   base.css 토큰 위에 얹는다. 데스크톱: 왼쪽 브랜드 패널 + 오른쪽 폼 카드 / 모바일: 1단. */

:root {
  --auth-panel:
    radial-gradient(900px 520px at 105% -8%, rgba(255, 255, 255, .26), transparent 62%),
    radial-gradient(760px 520px at -12% 112%, rgba(15, 159, 154, .62), transparent 64%),
    linear-gradient(140deg, #0f9f9a 0%, #2b7bf3 58%, #3b5bfd 100%);
  --fc-bg: rgba(255, 255, 255, .96);
  --fc-fg: #0f172a;
  --fc-muted: #64748b;
  --fc-line: #e5eaf1;
  --fc-border: rgba(255, 255, 255, .7);
  --fc-shadow: 0 26px 50px -18px rgba(6, 22, 78, .5), 0 4px 14px rgba(6, 22, 78, .16);
  --auth-input-h: 48px;
}
:root[data-theme="dark"] {
  --auth-panel:
    radial-gradient(900px 520px at 105% -8%, rgba(255, 255, 255, .12), transparent 62%),
    radial-gradient(760px 520px at -12% 112%, rgba(12, 120, 116, .55), transparent 64%),
    linear-gradient(140deg, #0b6f6b 0%, #1d56b8 58%, #2a3bb4 100%);
  --fc-bg: rgba(14, 22, 38, .9);
  --fc-fg: #e7edf5;
  --fc-muted: #8696ad;
  --fc-line: #24324a;
  --fc-border: rgba(255, 255, 255, .08);
  --fc-shadow: 0 26px 50px -18px rgba(0, 0, 0, .65), 0 4px 14px rgba(0, 0, 0, .3);
}

html { background: var(--bg); }
body.auth { min-height: 100vh; min-height: 100dvh; background: var(--bg); overflow-x: hidden; }

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

/* ───────────── 브랜드 패널 ───────────── */
.auth-brand {
  position: sticky; top: 14px;
  height: calc(100vh - 28px); height: calc(100dvh - 28px);
  margin: 14px 0 14px 14px;
  padding: 36px clamp(32px, 3.6vw, 56px) 28px;
  display: flex; flex-direction: column; gap: 26px;
  border-radius: 28px;
  background: var(--auth-panel);
  color: #fff;
  overflow: hidden;
  isolation: isolate;
}
/* 은은한 격자 */
.auth-brand::before {
  content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .07) 1px, transparent 1px);
  background-size: 44px 44px;
  -webkit-mask-image: radial-gradient(120% 80% at 70% 45%, #000 20%, transparent 75%);
  mask-image: radial-gradient(120% 80% at 70% 45%, #000 20%, transparent 75%);
}
.auth-brand-glow {
  position: absolute; z-index: -1; pointer-events: none;
  width: 520px; height: 520px; right: -160px; top: 30%;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(255, 255, 255, .22), transparent);
  filter: blur(8px);
}
.auth-brand .brand { color: #fff; font-size: 20px; align-self: flex-start; }
.auth-brand .brand b { background: none; color: rgba(255, 255, 255, .84); -webkit-text-fill-color: currentColor; }
.auth-brand .brand img { box-shadow: 0 0 0 2px rgba(255, 255, 255, .38), 0 8px 18px -6px rgba(4, 20, 70, .5); }

.auth-hero { display: flex; flex-direction: column; gap: 14px; max-width: 520px; }
.auth-eyebrow {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 9px;
  height: 30px; padding: 0 13px 0 11px; border-radius: var(--r-full);
  background: rgba(255, 255, 255, .15); border: 1px solid rgba(255, 255, 255, .26);
  font-size: 13px; font-weight: 700; letter-spacing: -.01em;
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.auth-eyebrow .pill-dot { color: #a7fff5; width: 7px; height: 7px; }
.auth-hero-title {
  margin: 4px 0 0; font-size: clamp(32px, 2.85vw, 44px); line-height: 1.16; font-weight: 800;
  letter-spacing: -.04em; text-wrap: balance;
}
.auth-hero-title span {
  background: linear-gradient(90deg, #d4fff9 0%, #ffffff 45%, #dde4ff 100%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.auth-hero-text { margin: 0; font-size: 16px; line-height: 1.65; color: rgba(255, 255, 255, .86); max-width: 440px; }

/* 떠 있는 문서 카드들 */
.auth-stage { position: relative; flex: 1 1 auto; min-height: 250px; max-height: 380px; }
.fcard, .fchip {
  position: absolute;
  background: var(--fc-bg); color: var(--fc-fg);
  border: 1px solid var(--fc-border);
  box-shadow: var(--fc-shadow);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: auth-float 7s ease-in-out infinite;
}
.fcard { border-radius: 16px; padding: 14px; }
.fcard-head { display: flex; align-items: center; gap: 10px; min-width: 0; }
.fcard-head img { flex: none; }
.fcard-name { display: flex; flex-direction: column; min-width: 0; line-height: 1.25; }
.fcard-name strong { font-size: 13px; font-weight: 700; letter-spacing: -.01em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.fcard-name small { font-size: 11px; color: var(--fc-muted); }
.fcard-head.sm .fcard-name strong { font-size: 12.5px; }
.fcard-people { display: flex; margin-left: auto; padding-left: 8px; }
.fcard-people i {
  width: 24px; height: 24px; border-radius: 50%; margin-left: -7px;
  display: grid; place-items: center; font-style: normal; font-size: 10.5px; font-weight: 700; color: #fff;
  border: 2px solid var(--fc-bg);
}

.fcard-doc { left: 0; top: 19%; width: clamp(240px, 58%, 340px); rotate: -2.2deg; animation-delay: -1.2s; }
.fcard-body { display: flex; flex-direction: column; gap: 9px; padding: 16px 4px 4px; }
.fcard-body .ln { position: relative; display: block; height: 7px; border-radius: 4px; background: var(--fc-line); }
.fcard-body .ln-title { height: 11px; width: 46%; background: var(--fc-fg); opacity: .82; margin-bottom: 4px; }
.fcard-body .ln-mark { background: color-mix(in srgb, #7c3aed 22%, var(--fc-line)); }
.fcard-body .cursor { position: absolute; right: -3px; top: -6px; width: 2px; height: 19px; border-radius: 1px; background: #7c3aed; }
.fcard-body .cursor::after {
  content: attr(data-name); position: absolute; left: 0; bottom: calc(100% + 2px);
  padding: 2px 6px; border-radius: 5px 5px 5px 0; background: #7c3aed; color: #fff;
  font-size: 10px; font-weight: 700; font-style: normal; white-space: nowrap; line-height: 1.4;
}

.fcard-sheet { right: 0; top: 0; width: clamp(150px, 38%, 214px); rotate: 3deg; animation-delay: -3.4s; animation-duration: 8s; }
.mini-bars { display: flex; align-items: flex-end; gap: 7px; height: 58px; margin-top: 12px; padding: 0 2px; border-bottom: 1px solid var(--fc-line); }
.mini-bars i { flex: 1; border-radius: 4px 4px 1px 1px; background: linear-gradient(180deg, #34d27a, #16a34a); }
.mini-bars i:nth-child(odd) { opacity: .62; }

.fcard-slide { right: 3%; bottom: 0; width: clamp(150px, 38%, 206px); rotate: -1.6deg; animation-delay: -5.1s; animation-duration: 7.6s; }
.mini-slide {
  position: relative; margin-top: 12px; aspect-ratio: 16 / 9; border-radius: 8px; padding: 12px 12px;
  background: linear-gradient(135deg, #fff4ea, #ffe3cc); overflow: hidden;
  display: flex; flex-direction: column; gap: 7px;
}
:root[data-theme="dark"] .mini-slide { background: linear-gradient(135deg, #2b1c12, #3a2414); }
.mini-slide span { display: block; border-radius: 4px; }
.ms-bar { width: 52%; height: 9px; background: #ea580c; }
.ms-line { width: 44%; height: 6px; background: color-mix(in srgb, #ea580c 28%, transparent); }
.ms-line.short { width: 30%; }
.ms-dot { position: absolute; right: 12px; bottom: 10px; width: 46px; height: 46px; border-radius: 50% !important; background: conic-gradient(#ea580c 0 64%, color-mix(in srgb, #ea580c 25%, transparent) 64% 100%); }

.fchip {
  display: inline-flex; align-items: center; gap: 8px;
  height: 42px; padding: 0 14px 0 9px; border-radius: var(--r-full);
  font-size: 12.5px; font-weight: 700; white-space: nowrap; letter-spacing: -.01em;
}
.fchip b { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: var(--r-full); color: #0b7a93; background: #d8f6fc; }
:root[data-theme="dark"] .fchip b { color: #67dcf2; background: rgba(14, 165, 198, .18); }
.fchip-hwp { left: 3%; bottom: 2%; rotate: 1.4deg; animation-delay: -2.2s; animation-duration: 6.4s; }
.fchip-pdf { left: 30%; top: 1%; rotate: -3deg; animation-delay: -4.4s; animation-duration: 6.8s; }

@keyframes auth-float { 0%, 100% { translate: 0 0; } 50% { translate: 0 -9px; } }

.auth-props { list-style: none; margin: 0; padding: 0; display: grid; gap: 11px; }
.auth-props li { display: flex; align-items: center; gap: 12px; font-size: 15px; color: rgba(255, 255, 255, .88); line-height: 1.4; }
.auth-props b { color: #fff; font-weight: 700; }
.prop-ic {
  flex: none; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center;
  background: rgba(255, 255, 255, .16); border: 1px solid rgba(255, 255, 255, .22);
}
.prop-ic svg { width: 17px; height: 17px; }
.auth-brand-foot { margin: auto 0 0; font-size: 12px; color: rgba(255, 255, 255, .62); }

/* ───────────── 폼 영역 ───────────── */
.auth-main {
  position: relative;
  display: flex; flex-direction: column; min-width: 0;
  min-height: 100vh; min-height: 100dvh;
  padding: calc(14px + var(--safe-top)) max(28px, var(--safe-right)) calc(14px + var(--safe-bottom)) max(28px, var(--safe-left));
}
.auth-top { display: flex; align-items: center; gap: 12px; min-height: 48px; }
.auth-top-brand { display: none; }
.auth-home {
  display: inline-flex; align-items: center; gap: 6px; height: 36px; padding: 0 10px 0 6px; margin-left: -6px;
  border-radius: var(--r-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--fg-3);
  transition: color var(--dur), background var(--dur);
}
.auth-home:hover { color: var(--fg); background: var(--bg-hover); }
.auth-home svg { width: 16px; height: 16px; }
.auth-lang { margin-left: auto; }
.auth-lang + .auth-theme { margin-left: 0; }
.auth-lang.lang-switch button { padding: 5px 10px; font-size: var(--fs-xs); }
.auth-theme { margin-left: auto; color: var(--fg-3); }
.auth-theme:hover { color: var(--fg); }
/* 영어 화면: 번역을 마칠 때까지 잠깐 감춰 한국어가 깜박이지 않게(auth.html 인라인 스크립트 · auth.js) */
.i18n-pending body { visibility: hidden; }

.auth-center {
  flex: 1 0 auto; display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 28px 0 36px;
}
.auth-kinds { display: none; }

.auth-card {
  position: relative; width: 100%; max-width: 448px;
  padding: 38px 40px 34px;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--r-xl);
  box-shadow: 0 30px 60px -30px rgba(15, 23, 42, .22), 0 2px 8px rgba(15, 23, 42, .04);
  transition: opacity .22s var(--ease);
  animation: auth-card-in .4s var(--ease) both;
}
:root[data-theme="dark"] .auth-card { box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .7), 0 0 0 1px rgba(255, 255, 255, .02); }
/* 브랜드 그라디언트 테두리 강조(상단) */
.auth-card::before {
  content: ""; position: absolute; left: 28px; right: 28px; top: -1px; height: 3px; border-radius: 0 0 3px 3px;
  background: var(--brand-gradient); opacity: .9;
}
@keyframes auth-card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
/* 이미 로그인했는지 확인하는 동안 폼을 잠깐 감춘다(JS가 못 돌아도 1.4초 뒤 표시) */
html.auth-pending .auth-card { opacity: 0; animation: auth-reveal 0s 1.4s forwards; }
@keyframes auth-reveal { to { opacity: 1; } }

.view { display: none; }
html[data-view="login"] .view[data-view="login"],
html[data-view="signup"] .view[data-view="signup"],
html[data-view="forgot"] .view[data-view="forgot"],
html[data-view="reset"] .view[data-view="reset"] { display: block; }

.view-head { margin-bottom: 26px; }
.view-head h1, .auth-state h1 {
  margin: 0 0 8px; font-size: 27px; line-height: 1.3; font-weight: 800; letter-spacing: -.035em; color: var(--fg);
  text-wrap: balance;
}
.view-head p { margin: 0; font-size: 15px; color: var(--fg-3); line-height: 1.55; }
.auth h1:focus { outline: none; box-shadow: none; }

.auth-form { display: flex; flex-direction: column; gap: 18px; }
.auth .field { gap: 7px; }
.auth .field > label, .field-row > label { font-size: 13.5px; font-weight: 650; color: var(--fg-2); }
.field-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.link-sm { font-size: 13px; font-weight: 600; color: var(--primary); white-space: nowrap; }
.link-sm:hover { text-decoration: underline; text-underline-offset: 3px; }

/* iOS 확대 방지: 16px 이상 */
.auth .input {
  height: var(--auth-input-h); padding: 0 14px; border-radius: 11px; font-size: 16px;
  background: var(--bg-elev); border-color: var(--border-strong);
}
.auth .input:hover:not(:focus) { border-color: color-mix(in srgb, var(--border-strong) 60%, var(--fg-3)); }
.auth .input[aria-invalid="true"] { border-color: var(--danger); }
.auth .input[aria-invalid="true"]:focus { box-shadow: 0 0 0 3px var(--danger-soft); }
.input-wrap { position: relative; }
.input-wrap .input { padding-right: 50px; }
.input-wrap .input::-ms-reveal { display: none; }
.pw-toggle {
  position: absolute; top: 4px; right: 4px; width: 40px; height: 40px;
  display: grid; place-items: center; border: 0; border-radius: 9px; background: transparent; color: var(--fg-3);
  -webkit-tap-highlight-color: transparent;
}
.pw-toggle:hover { color: var(--fg); background: var(--bg-hover); }
.pw-toggle svg { width: 19px; height: 19px; }

.field-error { margin: 0; display: flex; align-items: flex-start; gap: 6px; font-size: 13px; line-height: 1.45; color: var(--danger); }
.field-error svg { flex: none; width: 15px; height: 15px; margin-top: 2px; }
.field-ok { color: var(--success); }
.caps-hint { margin: 0; font-size: 12.5px; color: var(--warning); font-weight: 600; }

.auth .checkbox { align-items: flex-start; gap: 10px; font-size: 14.5px; line-height: 1.45; color: var(--fg-2); }
.auth .checkbox input { margin: 1px 0 0; flex: none; }
.auth .checkbox small { font-size: 12.5px; }
.auth .checkbox a { color: var(--primary); font-weight: 650; text-decoration: underline; text-decoration-color: color-mix(in srgb, var(--primary) 35%, transparent); text-underline-offset: 3px; }
.remember { margin-top: -2px; }

.auth-submit { margin-top: 4px; height: 52px; font-size: 16px; border-radius: 12px; }
.auth-submit.is-busy { pointer-events: none; }
.btn-spin {
  width: 18px; height: 18px; border-radius: 50%; flex: none;
  border: 2.5px solid rgba(255, 255, 255, .35); border-top-color: #fff; animation: spin .8s linear infinite;
}

.view-alt { margin: 24px 0 0; text-align: center; font-size: 14.5px; color: var(--fg-3); }
.view-alt a { color: var(--primary); font-weight: 700; margin-left: 4px; }
.view-alt a:hover { text-decoration: underline; text-underline-offset: 3px; }
.view-alt-muted { font-size: 13.5px; line-height: 1.55; padding: 12px 14px; border-radius: var(--r-md); background: var(--bg-sunken); }

/* 알림 상자 */
.auth-alert, .auth-notice {
  display: flex; align-items: flex-start; gap: 10px; margin: 0 0 18px; padding: 12px 14px;
  border-radius: var(--r-md); font-size: 14px; line-height: 1.5;
  background: var(--danger-soft); color: color-mix(in srgb, var(--danger) 82%, var(--fg));
  border: 1px solid color-mix(in srgb, var(--danger) 22%, transparent);
  animation: auth-shake .32s var(--ease);
}
.auth-alert svg, .auth-notice svg { flex: none; width: 18px; height: 18px; margin-top: 1px; }
.auth-alert a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; color: inherit; white-space: nowrap; }
.auth-alert.is-info, .auth-notice {
  background: var(--info-soft); color: color-mix(in srgb, var(--info) 60%, var(--fg));
  border-color: color-mix(in srgb, var(--info) 24%, transparent); animation: none;
}
.auth-notice.is-warning { background: var(--warning-soft); color: color-mix(in srgb, var(--warning) 70%, var(--fg)); border-color: color-mix(in srgb, var(--warning) 26%, transparent); }
.auth-notice.is-danger { background: var(--danger-soft); color: color-mix(in srgb, var(--danger) 80%, var(--fg)); border-color: color-mix(in srgb, var(--danger) 24%, transparent); }
@keyframes auth-shake { 0%, 100% { transform: none; } 30% { transform: translateX(-4px); } 60% { transform: translateX(3px); } }

/* 비밀번호 강도 */
.pw-strength { display: grid; gap: 7px; margin-top: 2px; }
.pw-meter { display: grid; grid-template-columns: repeat(4, 1fr); gap: 5px; }
.pw-meter i { height: 4px; border-radius: 2px; background: var(--bg-sunken); transition: background var(--dur) var(--ease); }
:root[data-theme="dark"] .pw-meter i { background: var(--border); }
.pw-strength[data-level="1"] .pw-meter i:nth-child(-n+1) { background: var(--danger); }
.pw-strength[data-level="2"] .pw-meter i:nth-child(-n+2) { background: var(--warning); }
.pw-strength[data-level="3"] .pw-meter i:nth-child(-n+3) { background: var(--brand-mid); }
.pw-strength[data-level="4"] .pw-meter i { background: var(--success); }
.pw-rules { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 16px; font-size: 12.5px; color: var(--fg-3); }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; transition: color var(--dur); }
.pw-rules li::before {
  content: ""; width: 14px; height: 14px; border-radius: 50%; flex: none; box-sizing: border-box;
  border: 1.5px solid var(--border-strong); transition: background var(--dur), border-color var(--dur);
}
.pw-rules li.ok { color: var(--success); }
.pw-rules li.ok::before {
  border-color: var(--success);
  background: var(--success) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23fff' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E") center / 9px no-repeat;
}
.pw-strength[data-attempted] .pw-rules li:not(.ok) { color: var(--danger); }
.pw-strength[data-attempted] .pw-rules li:not(.ok)::before { border-color: var(--danger); }
.pw-level { margin: 0; font-size: 12.5px; color: var(--fg-3); min-height: 0; }
.pw-level:empty { display: none; }
.pw-level b { font-weight: 700; }
.pw-strength[data-level="1"] .pw-level b { color: var(--danger); }
.pw-strength[data-level="2"] .pw-level b { color: var(--warning); }
.pw-strength[data-level="3"] .pw-level b { color: var(--brand-mid); }
.pw-strength[data-level="4"] .pw-level b { color: var(--success); }

/* 결과 상태(메일 발송·완료·닫힘) */
.auth-state { text-align: center; padding: 6px 0 2px; }
.auth-state p { margin: 0 0 6px; font-size: 15px; line-height: 1.65; color: var(--fg-2); }
.auth-state .hint { font-size: 13px; color: var(--fg-3); }
.auth-state .btn { margin-top: 22px; }
.auth-state .view-alt { margin-top: 16px; }
.state-ic {
  width: 64px; height: 64px; margin: 2px auto 20px; border-radius: 20px;
  display: grid; place-items: center; color: #fff; background: var(--brand-gradient);
  box-shadow: 0 14px 28px -12px rgba(43, 123, 243, .6);
}
.state-ic svg { width: 28px; height: 28px; }
.state-ic-muted { background: var(--bg-sunken); color: var(--fg-3); box-shadow: none; border: 1px solid var(--border); }
.state-ic-warn { background: var(--warning-soft); color: var(--warning); box-shadow: none; }
.state-ic-ok { background: linear-gradient(135deg, #22c55e, #0f9f9a); box-shadow: 0 14px 28px -12px rgba(22, 163, 74, .6); }

/* 하단 */
.auth-foot {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
  font-size: 12.5px; color: var(--fg-3); padding: 6px 0 4px;
}
.auth-foot nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; }
.auth-foot a:hover { color: var(--fg); }
.auth-foot b { font-weight: 700; }
.auth-foot p { margin: 0; color: var(--fg-4); }
.auth-noscript { position: fixed; left: 16px; right: 16px; bottom: 16px; margin: 0; padding: 12px 16px; border-radius: 12px; background: #b42318; color: #fff; text-align: center; }

/* ───────────── 반응형 ───────────── */
@media (min-width: 1024px) and (max-height: 820px) {
  .auth-brand { gap: 20px; padding-top: 30px; }
  .auth-props { display: none; }
}
@media (min-width: 1024px) and (max-height: 640px) {
  .auth-stage { display: none; }
}
@media (min-width: 1024px) and (max-width: 1180px) {
  .fchip-pdf { left: 22%; }
  .fchip-hwp b { display: none; }
  .fcard-name strong, .fcard-head.sm .fcard-name strong { font-size: 11.5px; }
  .fcard-head { gap: 8px; }
  .fcard-head img { width: 22px; height: 22px; }
  .fcard-people i:nth-child(3) { display: none; }
}

@media (max-width: 1023px) {
  .auth-shell { grid-template-columns: minmax(0, 1fr); }
  .auth-brand { display: none; }
  .auth-main {
    padding-left: max(20px, var(--safe-left)); padding-right: max(20px, var(--safe-right));
    background:
      radial-gradient(110% 340px at 50% -60px, color-mix(in srgb, #2b7bf3 13%, transparent), transparent 72%),
      radial-gradient(60% 260px at 0% 0%, color-mix(in srgb, #0f9f9a 12%, transparent), transparent 70%),
      var(--bg-app);
  }
  :root[data-theme="dark"] .auth-main {
    background:
      radial-gradient(110% 340px at 50% -60px, color-mix(in srgb, #2b7bf3 18%, transparent), transparent 72%),
      radial-gradient(60% 260px at 0% 0%, color-mix(in srgb, #0f9f9a 14%, transparent), transparent 70%),
      var(--bg-app);
  }
  html { background: var(--bg-app); }
  .auth-top-brand { display: inline-flex; min-width: 0; }
  .auth-home { display: none; }
  .auth-center { justify-content: flex-start; padding: 20px 0 28px; }
  .auth-kinds { display: flex; justify-content: center; gap: 10px; margin: 8px 0 22px; }
  .auth-kinds img {
    width: 34px; height: 34px; padding: 6px; box-sizing: content-box; border-radius: 14px;
    background: var(--bg-elev); border: 1px solid var(--border); box-shadow: var(--shadow-sm);
    animation: auth-float 6s ease-in-out infinite;
  }
  .auth-kinds img:nth-child(2) { animation-delay: -1.2s; }
  .auth-kinds img:nth-child(3) { animation-delay: -2.4s; }
  .auth-kinds img:nth-child(4) { animation-delay: -3.6s; }
  .auth-kinds img:nth-child(5) { animation-delay: -4.8s; }
  .auth-card { max-width: 460px; }
}
@media (max-width: 1023px) and (min-height: 900px) {
  .auth-center { justify-content: center; padding-bottom: 8vh; }
}

@media (max-width: 560px) {
  .auth-main { padding-left: max(16px, var(--safe-left)); padding-right: max(16px, var(--safe-right)); }
  .auth-top .brand { font-size: 18px; }
  .auth-top { gap: 8px; }
  .auth-lang.lang-switch button { padding: 5px 8px; }
  .auth-center { padding-top: 10px; }
  .auth-kinds { gap: 8px; margin-bottom: 18px; }
  .auth-kinds img { width: 28px; height: 28px; border-radius: 12px; }
  .auth-card { padding: 30px 22px 26px; border-radius: 20px; box-shadow: 0 18px 40px -24px rgba(15, 23, 42, .25); }
  .auth-card::before { left: 22px; right: 22px; }
  .view-head { margin-bottom: 22px; }
  .view-head h1, .auth-state h1 { font-size: 24px; }
  .view-head p { font-size: 14.5px; }
  .auth-form { gap: 16px; }
}
@media (max-width: 360px) {
  .auth-main { padding-left: max(12px, var(--safe-left)); padding-right: max(12px, var(--safe-right)); }
  .auth-card { padding: 26px 16px 22px; }
  .view-head h1, .auth-state h1 { font-size: 22px; }
  .auth-kinds { gap: 6px; }
  .auth-kinds img { width: 24px; height: 24px; padding: 5px; }
  .field-row { flex-wrap: wrap; row-gap: 2px; }
  .remember small { display: block; }
}

@media (prefers-reduced-motion: reduce) {
  .fcard, .fchip, .auth-kinds img, .auth-alert, .auth-card { animation: none !important; }
  html.auth-pending .auth-card { opacity: 1; }
}
