/* Cabinet */
.page-cab { min-height: 100vh; min-height: 100dvh; display: flex; flex-direction: column; }
.page-cab main { flex: 1; display: flex; }
.cab-view { flex: 1; display: none; }
.cab-view.on { display: flex; animation: cab-in .6s var(--ease) both; }
@keyframes cab-in { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes cab-zoom { from { transform: scale(1.12); } to { transform: scale(1); } }
@keyframes cab-shake { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.cab-boot { flex: 1; display: grid; place-items: center; }
.cab-boot i { width: 26px; height: 26px; border-radius: 50%; border: 2px solid var(--line-strong); border-top-color: var(--sakura); animation: cab-spin .8s linear infinite; }
@keyframes cab-spin { to { transform: rotate(360deg); } }

/* Auth */
.auth { width: 100%; display: grid; grid-template-columns: 1.1fr 1fr; min-height: calc(100dvh - 64px); margin-top: 64px; }
.auth-art { position: relative; overflow: hidden; }
.auth-art img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: cab-zoom 14s var(--ease) both; }
.auth-art::after { content: ""; position: absolute; inset: 0 -1px 0 0; background: linear-gradient(90deg, transparent 55%, var(--canvas)), linear-gradient(0deg, rgba(11, 10, 18, .85), transparent 45%); }
.auth-art p { position: absolute; left: 40px; bottom: 36px; z-index: 1; margin: 0; max-width: 380px; font: 500 30px/1.15 var(--sans); letter-spacing: -.01em; }
.auth-side { display: grid; place-items: center; padding: 40px 24px; }
.auth-card { width: 100%; max-width: 400px; }
.auth-card h1 { margin: 0 0 6px; font: 600 34px/1.1 var(--sans); letter-spacing: -.02em; }
.auth-card .sub { margin: 0 0 26px; color: var(--fog); font-size: 15px; }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 4px; margin-bottom: 24px; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); }
.seg button { position: relative; z-index: 1; height: 38px; border: 0; background: none; color: var(--fog); font-weight: 500; cursor: pointer; transition: color .25s var(--ease); }
.seg button[aria-selected="true"] { color: var(--text); }
.seg i { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--raised); box-shadow: inset 0 0 0 1px var(--line-strong); transition: transform .35s var(--ease); }
.seg.reg i { transform: translateX(100%); }
.fld { display: block; margin-bottom: 14px; }
.fld > span { display: block; margin-bottom: 6px; font-size: 13px; color: var(--fog); }
.inp { position: relative; }
.inp input { width: 100%; height: 48px; padding: 0 14px; border: 1px solid var(--line); border-radius: 11px; background: var(--surface); color: var(--text); font: inherit; transition: border-color .2s var(--ease), background .2s var(--ease); }
.inp input:hover { border-color: var(--line-strong); }
.inp input:focus { outline: none; border-color: var(--sakura); background: var(--raised); }
.inp input.bad { border-color: #e5677d; animation: cab-shake .35s; }
.inp .eye { position: absolute; right: 6px; top: 6px; width: 36px; height: 36px; display: grid; place-items: center; border: 0; border-radius: 8px; background: none; color: var(--ash); cursor: pointer; }
.inp .eye:hover { color: var(--text); }
.inp .eye svg { width: 18px; height: 18px; }
.inp:has(.eye) input { padding-right: 46px; }
.reg-only { display: grid; grid-template-rows: 0fr; opacity: 0; transition: grid-template-rows .4s var(--ease), opacity .3s var(--ease); }
.reg-only > div { overflow: hidden; }
.auth-card.reg .reg-only { grid-template-rows: 1fr; opacity: 1; }
.rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: -4px 0 14px; padding: 0; list-style: none; font-size: 12.5px; color: var(--ash); }
.rules li { display: flex; align-items: center; gap: 6px; transition: color .25s var(--ease); }
.rules li::before { content: ""; width: 7px; height: 7px; border-radius: 50%; border: 1.5px solid currentColor; transition: background .25s var(--ease); }
.rules li.ok { color: #8fd6a8; }
.rules li.ok::before { background: currentColor; }
.agree { display: flex; gap: 10px; align-items: flex-start; margin: 4px 0 18px; font-size: 13.5px; color: var(--fog); cursor: pointer; }
.agree input { appearance: none; flex: none; width: 18px; height: 18px; margin: 1px 0 0; border: 1.5px solid var(--line-strong); border-radius: 5px; background: var(--surface); cursor: pointer; transition: background .2s var(--ease), border-color .2s var(--ease); }
.agree input:checked { background: var(--sakura) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M4 8.5l2.5 2.5L12 5.5' fill='none' stroke='%230b0a12' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 14px no-repeat; border-color: var(--sakura); }
.agree a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); }
.auth-card .btn-light { width: 100%; height: 48px; justify-content: center; }
.form-msg { min-height: 20px; margin: 12px 0 0; font-size: 13.5px; color: #f08a9c; }
.form-msg.ok { color: #8fd6a8; }
.auth-foot { margin: 22px 0 0; font-size: 13.5px; color: var(--ash); }
.auth-foot a { color: var(--fog); text-decoration: underline; text-underline-offset: 3px; }

/* Panel */
.cab { width: 100%; max-width: 1040px; margin: 0 auto; padding: 104px 20px 64px; }
.cab-head { display: flex; align-items: center; gap: 16px; margin-bottom: 28px; }
.cab-ava { flex: none; width: 56px; height: 56px; display: grid; place-items: center; border-radius: 16px; background: linear-gradient(135deg, #f4a8c8, #8f7cf0); color: #0b0a12; font: 600 24px/1 var(--sans); }
.cab-head h1 { margin: 0; font: 600 30px/1.15 var(--sans); letter-spacing: -.02em; }
.cab-head p { margin: 2px 0 0; color: var(--fog); font-size: 14px; }
.cab-head .btn { margin-left: auto; }
.cab-grid { display: grid; grid-template-columns: 1.35fr 1fr; gap: 16px; }
.card { position: relative; padding: 24px; border: 1px solid var(--line); border-radius: 18px; background: var(--surface); animation: cab-in .6s var(--ease) both; }
.card:nth-child(2) { animation-delay: .08s; }
.card:nth-child(3) { animation-delay: .16s; }
.card:nth-child(4) { animation-delay: .24s; }
.card h2 { margin: 0 0 16px; font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em; color: var(--ash); }
.sub-card { grid-row: span 2; overflow: hidden; display: flex; flex-direction: column; }
.sub-card::before { content: ""; position: absolute; inset: -40% -20% auto auto; width: 70%; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(closest-side, rgba(244, 168, 200, .16), transparent); pointer-events: none; }
.sub-state { align-self: flex-start; display: inline-flex; align-items: center; gap: 8px; height: 28px; padding: 0 12px; border-radius: 99px; background: rgba(143, 214, 168, .12); color: #8fd6a8; font-size: 13px; font-weight: 500; }
.sub-state::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.sub-state.off { background: rgba(240, 138, 156, .12); color: #f08a9c; }
.sub-state.wait { background: rgba(163, 160, 180, .12); color: var(--fog); }
.sub-big { margin: 22px 0 4px; font: 600 64px/1 var(--sans); letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.sub-big small { margin-left: 8px; font-size: 18px; font-weight: 500; letter-spacing: 0; color: var(--fog); }
.sub-until { margin: 0; color: var(--fog); font-size: 14px; }
.bar { height: 6px; margin: 22px 0 6px; border-radius: 99px; background: var(--raised); overflow: hidden; }
.bar i { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, #8f7cf0, var(--sakura)); transition: width 1.2s var(--ease) .3s; }
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px 20px; margin: 22px 0 0; }
.facts div { min-width: 0; }
.facts dt { font-size: 12.5px; color: var(--ash); }
.facts dd { margin: 2px 0 0; font-size: 15px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.facts code { font: 500 14px/1.4 var(--mono); }
.sub-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 24px; }
.keys-switch { display: flex; flex-wrap: wrap; gap: 6px; margin: -4px 0 18px; }
.keys-switch button { height: 30px; padding: 0 12px; border: 1px solid var(--line); border-radius: 8px; background: none; color: var(--fog); font: 500 12.5px/1 var(--mono); cursor: pointer; }
.keys-switch button[aria-pressed="true"] { border-color: var(--sakura); color: var(--text); }
.empty { display: flex; flex-direction: column; flex: 1; justify-content: center; }
.empty p { margin: 0 0 18px; color: var(--fog); max-width: 380px; }
.dl-card { overflow: hidden; padding: 0; min-height: 210px; display: flex; flex-direction: column; justify-content: flex-end; }
.dl-card img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 1.2s var(--ease); }
.dl-card:hover img { transform: scale(1.05); }
.dl-card::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(11, 10, 18, .92) 20%, rgba(11, 10, 18, .2)); }
.dl-body { position: relative; z-index: 1; padding: 22px; }
.dl-body b { display: block; font-size: 18px; font-weight: 600; }
.dl-body span { display: block; margin: 2px 0 14px; color: var(--fog); font-size: 13px; }
.dl-card .btn-light.off { pointer-events: none; opacity: .45; }
.inline { display: flex; gap: 8px; }
.inline .inp { flex: 1; }
.inline .btn { height: 48px; flex: none; }
.card .note { margin: 10px 0 0; font-size: 13px; color: var(--ash); }
.pass-card { grid-column: 1 / -1; }
.pass-card summary { display: flex; justify-content: space-between; align-items: center; cursor: pointer; list-style: none; }
.pass-card summary::-webkit-details-marker { display: none; }
.pass-card summary h2 { margin: 0; }
.pass-card summary::after { content: "+"; font: 400 20px/1 var(--mono); color: var(--fog); transition: transform .3s var(--ease); }
.pass-card[open] summary::after { transform: rotate(45deg); }
.pass-form { display: grid; grid-template-columns: 1fr 1fr auto; gap: 8px; margin-top: 18px; }
.pass-form .btn { height: 48px; }

@media (max-width: 860px) {
  .auth { grid-template-columns: 1fr; position: relative; }
  .auth-art { position: absolute; inset: 0; }
  .auth-art::after { background: linear-gradient(0deg, var(--canvas) 12%, rgba(11, 10, 18, .35) 60%, rgba(11, 10, 18, .15)); }
  .auth-side { align-items: center; }
  .auth-art p { display: none; }
  .auth-side { position: relative; align-items: end; padding: 120px 16px 32px; }
  .auth-card { padding: 22px; border: 1px solid var(--line); border-radius: 20px; background: rgba(19, 18, 28, .82); backdrop-filter: blur(18px); }
  .cab { padding: 88px 16px 48px; }
  .cab-grid { grid-template-columns: 1fr; }
  .sub-card { grid-row: auto; }
  .sub-big { font-size: 52px; }
  .pass-form { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .cab-head { flex-wrap: wrap; }
  .cab-head h1 { font-size: 24px; }
  .facts { grid-template-columns: 1fr; }
  .inline { flex-direction: column; }
  .auth-card h1 { font-size: 28px; }
}
@media (prefers-reduced-motion: reduce) {
  .cab-view.on, .card, .auth-art img { animation: none; }
  .bar i, .seg i, .reg-only { transition: none; }
}

/* Key */
.key-fact { grid-column: 1 / -1; }
.key-fact dd { display: flex; align-items: center; gap: 4px; overflow: visible; }
.key-fact code { margin-right: 6px; }
.key-btn { position: relative; width: 30px; height: 30px; display: grid; place-items: center; border: 1px solid transparent; border-radius: 8px; background: none; color: var(--ash); cursor: pointer; transition: color .2s var(--ease), background .2s var(--ease), border-color .2s var(--ease); }
.key-btn:hover, .key-btn.on { color: var(--text); background: var(--raised); border-color: var(--line); }
.key-btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linejoin: round; }
.key-tip { position: absolute; bottom: calc(100% + 6px); left: 50%; padding: 4px 8px; border-radius: 6px; background: var(--paper); color: #0b0a12; font-size: 12px; white-space: nowrap; opacity: 0; transform: translate(-50%, 4px); pointer-events: none; transition: opacity .2s var(--ease), transform .2s var(--ease); }
.key-btn.done { color: #8fd6a8; }
.key-btn.done .key-tip { opacity: 1; transform: translate(-50%, 0); }

/* Mail */
.link-btn { display: block; margin: 14px auto 0; padding: 4px; border: 0; background: none; color: var(--fog); font-size: 13.5px; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: var(--line-strong); transition: color .2s var(--ease); }
.link-btn:hover { color: var(--text); }
.auth-card.reg .login-only { display: none; }
.mail-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; margin-bottom: 16px; padding: 16px 20px; border: 1px solid rgba(244, 168, 200, .35); border-radius: 16px; background: linear-gradient(90deg, rgba(244, 168, 200, .1), rgba(143, 124, 240, .08)); animation: cab-in .6s var(--ease) both; }
.mail-bar p { flex: 1 1 260px; margin: 0; font-size: 14.5px; color: var(--fog); }
.mail-bar b { color: var(--text); font-weight: 500; }
.mail-bar form { display: flex; flex: 1 1 320px; gap: 8px; }
.mail-bar .inp { flex: 1; }
.mail-bar .inp input { height: 40px; }
.mail-bar .btns { display: flex; gap: 8px; }
.mail-bar .form-msg { flex-basis: 100%; min-height: 0; margin: 0; }
.mail-ok { color: #8fd6a8; }
.notice { position: fixed; left: 50%; top: 80px; z-index: 40; max-width: calc(100% - 32px); padding: 12px 18px; border-radius: 12px; background: var(--paper); color: #0b0a12; font-size: 14.5px; font-weight: 500; box-shadow: 0 10px 30px rgba(0, 0, 0, .4); transform: translate(-50%, -12px); opacity: 0; transition: opacity .3s var(--ease), transform .3s var(--ease); }
.notice.on { opacity: 1; transform: translate(-50%, 0); }
.notice.bad { background: #f08a9c; }
.mail-bar[hidden] { display: none; }
