@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,500;1,9..144,500&family=Inter:wght@400;500;600;700&display=swap");

:root {
  --logo-tag-white: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg transform='rotate(-30 60 60)'%3E%3Cpath d='M40 34H88a6 6 0 0 1 6 6V80a6 6 0 0 1-6 6H40L22 60Z' fill='%23fff'/%3E%3Ccircle cx='38' cy='60' r='5' fill='%233457D5'/%3E%3Cg transform='translate(50 40) scale(.36)' fill='%233457D5'%3E%3Cpath d='M40 18C43.2 48.4 49.6 54.8 80 58 49.6 61.2 43.2 67.6 40 98 36.8 67.6 30.4 61.2 0 58 30.4 54.8 36.8 48.4 40 18Z'/%3E%3Cpath d='M80 2C81.28 14.16 83.84 16.72 96 18 83.84 19.28 81.28 21.84 80 34 78.72 21.84 76.16 19.28 64 18 76.16 16.72 78.72 14.16 80 2Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
  --logo-tag: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg transform='rotate(-30 60 60)'%3E%3Cpath d='M40 34H88a6 6 0 0 1 6 6V80a6 6 0 0 1-6 6H40L22 60Z' fill='%233457D5'/%3E%3Ccircle cx='38' cy='60' r='5' fill='%23fff'/%3E%3C/g%3E%3C/svg%3E");
  --ink: #141821;
  --muted: #5f6673;
  --line: #e4e4e1;
  --paper: #f7f7f5;
  --card: #ffffff;
  --accent: #3457d5;
  --accent-ink: #ffffff;
  --glow: #f4c430;
  --danger: #c2362b;
  --ok: #1d7a4a;
  --radius: 14px;
  --step--1: .875rem;
  --step-0: 1rem;
  --step-1: 1.25rem;
  --step-2: 1.6rem;
  --step-3: clamp(2rem, 5vw, 3.2rem);
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font-family: Inter, system-ui, sans-serif;
  font-size: var(--step-0);
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3 { font-family: Fraunces, Georgia, serif; font-weight: 400; line-height: 1.1; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: var(--step-3); }
h2 { font-size: var(--step-1); }
a { color: var(--accent); }
p { margin: 0 0 1em; }
.muted { color: var(--muted); }
.small { font-size: var(--step--1); }

/* Логотип: ценник Shyba */
.logo { display: inline-flex; align-items: flex-start; gap: 0; padding-top: .45em; font-family: Fraunces, Georgia, serif; font-style: italic; font-weight: 500; color: var(--ink); text-decoration: none; font-size: 1.6rem; line-height: 1; }
.logo-mark { order: 2; width: 1.3em; height: 1.3em; margin: -.5em 0 0 -.06em; flex: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'%3E%3Cg transform='rotate(-30 60 60)'%3E%3Cpath d='M40 34H88a6 6 0 0 1 6 6V80a6 6 0 0 1-6 6H40L22 60Z' fill='%233457D5'/%3E%3Ccircle cx='38' cy='60' r='5' fill='%23F7F7F5'/%3E%3Cg transform='translate(50 40) scale(.36)' fill='%23fff'%3E%3Cpath d='M40 18C43.2 48.4 49.6 54.8 80 58 49.6 61.2 43.2 67.6 40 98 36.8 67.6 30.4 61.2 0 58 30.4 54.8 36.8 48.4 40 18Z'/%3E%3Cpath d='M80 2C81.28 14.16 83.84 16.72 96 18 83.84 19.28 81.28 21.84 80 34 78.72 21.84 76.16 19.28 64 18 76.16 16.72 78.72 14.16 80 2Z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E") center / contain no-repeat; flex: none; }

/* Формы */
label { display: block; font-weight: 600; font-size: var(--step--1); margin: 0 0 .3rem; }
.field { margin-bottom: 1rem; }
input, select, textarea {
  width: 100%; font: inherit; color: var(--ink);
  padding: .75rem .9rem; border: 1.5px solid var(--line); border-radius: 10px; background: #fff;
}
input:focus-visible, select:focus-visible, textarea:focus-visible, button:focus-visible, a:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 1px; border-color: var(--accent);
}
.hint { color: var(--muted); font-size: var(--step--1); margin-top: .3rem; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .6rem;
  font: inherit; font-weight: 600; cursor: pointer; text-decoration: none;
  min-height: 48px; padding: .8rem 1.3rem; border-radius: 999px; border: 1.5px solid var(--accent);
  background: var(--accent); color: var(--accent-ink);
}
.btn:hover { filter: brightness(1.08); }
.btn[disabled] { opacity: .6; cursor: default; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.danger { background: var(--danger); border-color: var(--danger); }
.btn.wide { width: 100%; }
.google-btn { background: #fff; color: var(--ink); border-color: var(--line); }
.google-btn svg { width: 18px; height: 18px; }
.divider { display: flex; align-items: center; gap: .8rem; color: var(--muted); font-size: var(--step--1); margin: 1.2rem 0; }
.divider::before, .divider::after { content: ""; flex: 1; height: 1px; background: var(--line); }

.msg { padding: .75rem .9rem; border-radius: 10px; margin-bottom: 1rem; font-size: var(--step--1); }
.msg.error { background: #fbe9e7; color: #8e231b; }
.msg.ok { background: #e5f4ec; color: #165c38; }
.msg:empty { display: none; }

/* Страницы входа: форма по центру на тёмной полупрозрачной карточке */
.auth-page { background: var(--accent); min-height: 100vh; position: relative; overflow-x: hidden; }
.auth-bg { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.auth-bg svg { position: absolute; }
.auth-bg .t1 { right: -200px; top: -220px; }
.auth-bg .t2 { left: -150px; bottom: -170px; }
.auth-bg .t3 { left: -90px; top: -110px; }
.auth-bg .t4 { right: -110px; bottom: -190px; }
.auth-wrap { position: relative; z-index: 1; min-height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 24px 20px 28px; }
.auth-top { width: 100%; max-width: 1120px; margin-bottom: 24px; display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.logo.light { color: #fff; }
.logo.light .logo-mark { background-image: var(--logo-tag-white); }
.auth-top .back { color: #dfe6fd; font-size: var(--step--1); text-decoration: none; padding: 10px 4px; }
.auth-top .back:hover { color: #fff; text-decoration: underline; }
.auth-card { width: 100%; max-width: 460px; margin: auto 0; padding: 40px 40px 36px; border-radius: 24px; background: rgba(14, 18, 32, .62); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 40px 80px -30px rgba(5, 10, 40, .6); color: #fff; }
.auth-card h1 { font-size: clamp(1.9rem, 3vw, 2.4rem); margin-bottom: .3em; color: #fff; }
.auth-card .lede { color: #c3cbe0; margin-bottom: 1.6rem; }
.auth-card a { color: #b9cbff; }
.auth-card a:not(.btn):hover { color: #fff; }
.auth-card label { color: #e6eaf5; }
.auth-card .hint { color: #a9b3cc; }
.auth-card .muted { color: #a9b3cc; }
.auth-card .field { margin-bottom: 1.15rem; }
.auth-card input { height: 52px; padding: 0 16px; border-radius: 12px; font-size: 16px; background: #fff; border-color: transparent; transition: box-shadow .15s; }
.auth-card input::placeholder { color: #9aa0aa; }
.auth-card input:focus-visible { outline: none; border-color: #8fa6f5; box-shadow: 0 0 0 4px rgba(143, 166, 245, .35); }
.auth-card .btn:focus-visible, .auth-card a:focus-visible { outline: 3px solid #8fa6f5; outline-offset: 2px; }
.label-row { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.label-row a { margin-bottom: .3rem; }
.pw-wrap { position: relative; }
.pw-wrap input { padding-right: 52px; }
.eye { position: absolute; right: 4px; top: 4px; width: 44px; height: 44px; border: 0; border-radius: 10px; background: transparent; color: #6b7280; display: inline-flex; align-items: center; justify-content: center; cursor: pointer; }
.eye:hover { color: var(--ink); background: #f1f1ee; }
.eye .eye-off { display: none; }
.eye[aria-pressed="true"] .eye-on { display: none; }
.eye[aria-pressed="true"] .eye-off { display: block; }
.pw-rules { list-style: none; margin: .6rem 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.pw-rules li { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px 5px 8px; border-radius: 999px; background: rgba(255, 255, 255, .08); color: #c3cbe0; font-size: 13px; transition: background .15s, color .15s; }
.pw-rules li::before { content: ""; width: 14px; height: 14px; border-radius: 999px; border: 1.5px solid rgba(255, 255, 255, .35); box-sizing: border-box; }
.pw-rules li.ok { background: rgba(74, 222, 128, .16); color: #b7f5cc; }
.pw-rules li.ok::before { border: 0; background: #34c26a url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 10px no-repeat; }
.pw-match { margin-top: .5rem; font-size: 13px; }
.pw-match.ok { color: #b7f5cc; }
.pw-match.bad { color: #ffb4a6; }
.auth-card .btn.big { min-height: 54px; font-size: 17px; margin-top: .4rem; background: #fff; border-color: #fff; color: var(--accent); font-weight: 700; box-shadow: 0 14px 30px -14px rgba(0, 0, 0, .6); }
.auth-card .btn.big:hover { background: #eef2ff; filter: none; }
.auth-card .btn.ghost { color: #fff; border-color: rgba(255, 255, 255, .3); }
.auth-card .google-btn { background: #fff; color: var(--ink); border-color: #fff; transition: background .15s, box-shadow .15s; }
.auth-card .google-btn:hover { background: #eef2ff; color: var(--ink); filter: none; box-shadow: 0 10px 24px -14px rgba(0, 0, 0, .6); }
.auth-card .divider { color: #a9b3cc; }
.auth-card .divider::before, .auth-card .divider::after { background: rgba(255, 255, 255, .16); }
.terms { margin: 1rem 0 0; }
.center { text-align: center; margin-top: 1.2rem; }
.perks { list-style: none; margin: 1.6rem 0 0; padding: 1.2rem 0 0; border-top: 1px solid rgba(255, 255, 255, .14); display: flex; flex-wrap: wrap; gap: 10px 20px; color: #c3cbe0; font-size: 14px; }
.perks li { display: inline-flex; align-items: center; gap: 8px; }
.perks li::before { content: ""; width: 18px; height: 18px; border-radius: 999px; background: rgba(255, 255, 255, .14) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M6 12.5l4 4L18 8' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") center / 11px no-repeat; }
.auth-foot { color: #c9d3f5; font-size: var(--step--1); margin: 24px 0 0; }
@media (max-width: 560px) {
  .auth-wrap { padding: 16px 12px 20px; }
  .auth-card { padding: 28px 20px 24px; border-radius: 20px; margin: 24px 0 auto; }
  .auth-bg .t1 { width: 340px; height: 340px; right: -160px; top: -140px; }
  .auth-bg .t2 { width: 300px; height: 300px; left: -150px; bottom: -130px; }
  .auth-bg .t3, .auth-bg .t4 { display: none; }
}

/* Кабинет */
.topbar { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 14px clamp(16px, 4vw, 40px); background: var(--card); border-bottom: 1px solid var(--line); }
.topbar .who { display: flex; align-items: center; gap: .8rem; font-size: var(--step--1); }
.layout { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px; max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 4vw, 40px) 80px; }
.side nav { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 2px; }
.side nav a { padding: .55rem .8rem; border-radius: 8px; color: var(--ink); text-decoration: none; font-weight: 600; }
.side nav a[aria-current="true"] { background: var(--card); box-shadow: inset 3px 0 0 var(--accent); }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: clamp(18px, 3vw, 28px); margin-bottom: 24px; }
.panel h2 { margin-bottom: .3em; }
.panel > .muted { margin-bottom: 1.2rem; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 16px; }
.sites { list-style: none; margin: 0 0 1.2rem; padding: 0; }
.sites li { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.sites li:first-child { border-top: 1px solid var(--line); }
.sites .name { font-weight: 700; }
.sites a.url { font-size: var(--step--1); word-break: break-all; }
.sites .actions { display: flex; gap: .5rem; flex-shrink: 0; }
.sites .actions .btn { padding: .5rem .8rem; font-size: var(--step--1); }
.empty { padding: 1.2rem; border: 1.5px dashed var(--line); border-radius: 10px; color: var(--muted); margin-bottom: 1.2rem; }
.slug-field { display: flex; align-items: stretch; }
.slug-field span { display: flex; align-items: center; padding: 0 .7rem; border: 1.5px solid var(--line); border-right: 0; border-radius: 10px 0 0 10px; background: var(--paper); color: var(--muted); font-size: var(--step--1); white-space: nowrap; }
.slug-field input { border-radius: 0 10px 10px 0; }
@media (max-width: 760px) {
  .layout { grid-template-columns: 1fr; gap: 0; padding-top: 16px; }
  .side nav { position: static; flex-direction: row; overflow-x: auto; margin-bottom: 16px; }
  .side nav a { white-space: nowrap; }
  .grid2 { grid-template-columns: 1fr; }
  .sites li { flex-direction: column; align-items: flex-start; }
  .topbar .who .email { display: none; }
  .slug-field span { max-width: 45%; overflow: hidden; text-overflow: ellipsis; }
}

@media (prefers-reduced-motion: reduce) { * { transition: none !important; animation: none !important; } }

[hidden] { display: none !important; }
.side, main { min-width: 0; }
input:disabled { background: var(--paper); color: var(--muted); }

/* Экран ввода кода из письма */
.code-step { text-align: center; }
.code-step[hidden], .step-main[hidden] { display: none; }
.code-step h1:focus { outline: none; }
.code-step .lede b { display: block; margin: .15em 0; color: #fff; font-weight: 600; overflow-wrap: anywhere; }
.code-badge { display: inline-grid; place-items: center; width: 60px; height: 60px; border-radius: 18px; margin-bottom: 18px; background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .16); color: #fff; }
.code-form { text-align: left; }
.code-form label { display: block; margin-bottom: .45rem; }
.auth-card .code-input { width: 100%; height: 68px; text-align: center; font-family: "Courier New", ui-monospace, monospace; font-size: 34px; font-weight: 700; letter-spacing: .22em; color: #2643b0; padding: 0 0 0 .22em; }
.auth-card .code-input::placeholder { color: #c9cdd6; }
.code-form .hint { margin-top: .5rem; margin-bottom: .6rem; }
.code-actions { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 1.1rem; }
.linkish { background: none; border: 0; padding: 4px 0; font: inherit; font-size: 15px; color: #b9cbff; cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.linkish:hover { color: #fff; }
.linkish:disabled { color: #8d97b3; text-decoration: none; cursor: default; }
.linkish:focus-visible { outline: 3px solid #8fa6f5; outline-offset: 2px; border-radius: 4px; }
.code-tip { margin-top: 1.4rem; padding-top: 1.1rem; border-top: 1px solid rgba(255, 255, 255, .14); }
.code-step .dev-note { margin: -.4rem 0 1rem; }
@media (max-width: 560px) { .code-actions { flex-direction: column; align-items: center; gap: 6px; } .auth-card .code-input { height: 62px; font-size: 30px; } }

/* Юридические страницы */
.legal-page { background: var(--paper, #f7f7f5); color: var(--ink); }
.legal-top { max-width: 1080px; margin: 0 auto; padding: 22px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.legal { max-width: 720px; margin: 0 auto; padding: 24px 24px 64px; font-size: 17px; line-height: 1.7; }
.legal h1 { font-size: clamp(2.2rem, 5vw, 3.2rem); line-height: 1.1; margin: .4em 0 .3em; }
.legal .lede { font-size: 1.15rem; color: #4a505c; margin: 0 0 .6rem; }
.legal .updated { font-size: 14px; color: #8a909b; margin: 0 0 2rem; }
.legal-toc { background: #fff; border: 1px solid #e4e4e1; border-radius: 16px; padding: 18px 24px; margin-bottom: 2.4rem; }
.legal-toc ol { margin: 0; padding-left: 1.2em; columns: 2; column-gap: 32px; font-size: 15px; line-height: 1.9; }
.legal-toc a { color: var(--accent); text-decoration: none; }
.legal-toc a:hover { text-decoration: underline; }
.legal section { scroll-margin-top: 20px; }
.legal h2 { font-size: 1.55rem; margin: 2.2rem 0 .6rem; }
.legal p, .legal li { color: #2f3440; }
.legal ul { padding-left: 1.2em; }
.legal li { margin-bottom: .45rem; }
.legal a { color: var(--accent); }
.legal-foot { max-width: 720px; margin: 0 auto; padding: 24px 24px 40px; border-top: 1px solid #e4e4e1; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px; font-size: 14px; color: #8a909b; }
.legal-foot a { color: inherit; }
@media (max-width: 560px) { .legal { font-size: 16px; } .legal-toc ol { columns: 1; } .legal-top .btn { padding: 0 14px; } }

.pw-warn { margin-top: .5rem; padding: 8px 12px; border-radius: 10px; background: rgba(255, 120, 100, .14); color: #ffc2b6; font-size: 13px; }
.pw-warn[hidden] { display: none; }
.auth-card input[aria-invalid="true"] { box-shadow: 0 0 0 3px rgba(255, 120, 100, .55); }
