* { box-sizing: border-box; }
html { color-scheme: light; scroll-behavior: smooth; }
body { margin: 0; color: var(--navy); background: var(--canvas); font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; font-size: 15px; line-height: 1.55; }
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: var(--blue); text-decoration: none; }
a:hover { color: var(--blue-dark); }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { color: var(--navy); line-height: 1.25; letter-spacing: -0.025em; }
h1 { font-size: clamp(1.15rem, 2vw, 1.35rem); margin-bottom: 0; }
h2 { font-size: clamp(1.55rem, 3vw, 2rem); margin-bottom: .45rem; }
h3 { font-size: 1.05rem; margin-bottom: .3rem; }
p { color: var(--muted); }
:focus-visible { outline: 3px solid rgba(8, 102, 255, .3); outline-offset: 2px; }
[hidden] { display: none !important; }
.skip-link { position: fixed; z-index: 1000; top: 8px; left: 8px; padding: 10px 14px; background: var(--navy); color: white; border-radius: 8px; transform: translateY(-150%); }
.skip-link:focus { transform: translateY(0); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; }
.app-shell { min-height: 100vh; display: grid; grid-template-columns: var(--sidebar-width) minmax(0, 1fr); transition: grid-template-columns var(--transition); }
.app-shell.is-collapsed { grid-template-columns: var(--sidebar-collapsed) minmax(0, 1fr); }
.app-column { min-width: 0; }
.main-content { width: min(1500px, 100%); margin: 0 auto; padding: 32px clamp(20px, 3vw, 48px) 56px; }
.page-heading { margin-bottom: 24px; }
.page-heading > p, .page-heading > div > p { margin-bottom: 0; max-width: 720px; }
.split-heading { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.eyebrow, .auth-kicker { display: block; margin-bottom: 5px; color: var(--blue); font-size: .72rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; }
.mono-text { font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .79rem; overflow-wrap: anywhere; }
.break-text { overflow-wrap: anywhere; }
.auth-body { min-height: 100vh; background: var(--surface); }
.auth-main { min-height: 100vh; }
.auth-layout { min-height: 100vh; display: grid; grid-template-columns: minmax(340px, .82fr) minmax(480px, 1.18fr); }
.auth-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; padding: clamp(32px, 5vw, 72px); background: #f0f6ff; }
.auth-intro::after { content: ""; position: absolute; width: 360px; height: 360px; right: -160px; bottom: -170px; border: 72px solid rgba(8,102,255,.07); border-radius: 50%; }
.auth-intro h1 { max-width: 620px; font-size: clamp(2rem, 4vw, 3.4rem); line-height: 1.08; margin: 0 0 20px; }
.auth-intro p { max-width: 560px; font-size: 1.03rem; }
.auth-card-wrap { display: grid; place-items: center; padding: 32px; }
.auth-card { width: min(440px, 100%); padding: clamp(28px, 4vw, 42px); border: 1px solid var(--border); border-radius: var(--radius-lg); box-shadow: var(--shadow-md); background: var(--surface); }
.auth-card-wide { width: min(650px, 100%); }
.auth-card-heading { margin-bottom: 26px; }
.auth-card-heading h2 { font-size: 1.55rem; }
.auth-card-heading p { margin-bottom: 0; }
.auth-switch { margin: 24px 0 0; text-align: center; font-size: .9rem; }
.auth-switch a { font-weight: 700; }
.telegram-login-wrap { display: grid; place-items: center; gap: 10px; min-height: 56px; padding: 16px; border: 1px solid var(--border); border-radius: 12px; background: #f7fbff; text-align: center; }
.telegram-bot-login { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 44px; padding: 0 22px; color: #fff; background: #2aabee; border-radius: 999px; font-weight: 800; text-decoration: none; box-shadow: 0 14px 26px rgba(42,171,238,.24); }
.telegram-bot-login:hover { color: #fff; background: #1d9bdc; transform: translateY(-1px); }
.telegram-login-help { max-width: 340px; margin: 0; font-size: .78rem; color: var(--muted); }
.trust-note { position: relative; z-index: 1; display: flex; gap: 10px; align-items: center; color: var(--navy); font-size: .88rem; font-weight: 600; }
.trust-note span { display: grid; place-items: center; width: 24px; height: 24px; color: var(--success); background: var(--success-soft); border-radius: 50%; }
@media (max-width: 900px) {
  .auth-layout { grid-template-columns: 1fr; }
  .auth-intro { min-height: 260px; gap: 36px; padding: 28px; }
  .auth-intro h1 { font-size: 2rem; }
  .auth-card-wrap { padding: 28px 18px 44px; }
  .split-heading { align-items: flex-start; }
}
@media (max-width: 720px) {
  .app-shell { display: block; }
  .main-content { padding: 24px 16px 42px; }
  .split-heading { flex-direction: column; }
  .split-heading > .button { width: 100%; }
  .auth-intro { min-height: 220px; }
  .auth-intro > div:not(.trust-note), .trust-note { display: none; }
  .auth-card { padding: 26px 20px; }
}
/* Modern toggle switch */
.switch { font-size: 17px; position: relative; display: inline-block; width: 3.5em; height: 2em; }
.switch input { opacity: 0; width: 0; height: 0; }
.slider { position: absolute; cursor: pointer; top: 0; left: 0; right: 0; bottom: 0; background-color: rgb(182,182,182); transition: .4s; border-radius: 10px; }
.slider:before { position: absolute; content: ""; height: 1.4em; width: 1.4em; border-radius: 8px; left: .3em; bottom: .3em; transform: rotate(270deg); background-color: rgb(255,255,255); transition: .4s; }
.switch input:checked + .slider { background-color: #21cc4c; }
.switch input:focus + .slider { box-shadow: 0 0 1px #2196F3; }
.switch input:checked + .slider:before { transform: translateX(1.5em); }
.proxy-toggle-row { display: flex; align-items: center; gap: 12px; padding: 12px 0; }
.proxy-toggle-label { font-size: .92rem; font-weight: 600; color: var(--navy); user-select: none; }
/* Proxy settings card */
.proxy-settings-panel { border: 1px solid #dde4ed; border-radius: var(--radius-lg, 14px); box-shadow: 0 1px 3px rgba(0,0,0,.04), 0 4px 16px rgba(0,0,0,.03); background: #fff; }
.proxy-settings-panel .section-heading { gap: 14px; align-items: flex-start; }
.proxy-settings-panel .section-heading > div { flex: 1; }
.proxy-settings-panel .section-heading h3 { display: flex; align-items: center; gap: 10px; margin-bottom: 4px; }
.proxy-settings-panel .section-heading h3 img { height: 26px; }
.proxy-badge { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 20px; font-size: .7rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; background: #e8f0fe; color: #1a73e8; white-space: nowrap; }
.proxy-badge::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #1a73e8; }
.proxy-settings-panel .proxy-desc { color: var(--muted); font-size: .88rem; line-height: 1.45; margin: 0; }
.proxy-settings-panel .proxy-desc code { background: #f0f4fa; padding: 1px 7px; border-radius: 5px; font-size: .82rem; color: var(--navy); }
.proxy-settings-panel .settings-form { margin-top: 18px; }
.proxy-country-row { display: flex; gap: 12px; align-items: stretch; }
.proxy-country-row .search-select { flex: 1; min-width: 0; }
.proxy-test-col { flex: 0 0 176px; display: flex; align-items: stretch; }
.proxy-test-col .button {
  width: 100%;
  min-height: 48px;
  padding: 0 20px;
  color: var(--blue);
  background: linear-gradient(180deg, #fff, #f7fbff);
  border: 1px solid rgba(8,102,255,.32);
  border-radius: 12px;
  box-shadow: 0 8px 18px rgba(8,102,255,.10);
  font-weight: 800;
  white-space: nowrap;
}
.proxy-test-col .button:hover {
  color: #fff;
  background: var(--blue);
  border-color: var(--blue);
  box-shadow: 0 10px 22px rgba(8,102,255,.20);
}
@media (max-width: 600px) {
  .proxy-country-row { flex-direction: column; align-items: stretch; }
  .proxy-test-col { flex-basis: auto; width: 100%; }
  .proxy-test-col .button { width: 100%; }
}
/* Animated proxy card */
.proxy-card { position: relative; width: 200px; height: 250px; border-radius: 14px; z-index: 1; overflow: hidden; display: flex; flex-direction: column; align-items: center; justify-content: center; box-shadow: 20px 20px 60px #bebebe, -20px -20px 60px #ffffff; margin: 0 auto 16px; }
.proxy-card .bg { position: absolute; top: 5px; left: 5px; width: 190px; height: 240px; z-index: 2; background: rgba(255,255,255,.95); backdrop-filter: blur(24px); border-radius: 10px; overflow: hidden; outline: 2px solid white; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; }
.proxy-card .blob { position: absolute; z-index: 1; top: 50%; left: 50%; width: 150px; height: 150px; border-radius: 50%; background-color: #ff0000; opacity: 1; filter: blur(12px); animation: blob-bounce 5s infinite ease; }
@keyframes blob-bounce {
  0% { transform: translate(-100%,-100%) translate3d(0,0,0); }
  25% { transform: translate(-100%,-100%) translate3d(100%,0,0); }
  50% { transform: translate(-100%,-100%) translate3d(100%,100%,0); }
  75% { transform: translate(-100%,-100%) translate3d(0,100%,0); }
  100% { transform: translate(-100%,-100%) translate3d(0,0,0); }
}
.proxy-card .proxy-card-label { font-size: .72rem; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .06em; }
.proxy-card .proxy-card-title { font-size: .88rem; font-weight: 600; color: var(--navy); }
