/* ---------------------------------------------------------------- base --- */

:root {
  --blue: #00aff0;
  --blue-dark: #0091ea;
  --ink: #242529;
  --muted: #8a96a3;
  --line: rgba(0, 0, 0, .07);
  --tg: #4285f4;
  --tg-hover: #3367d6;
  --glass-bg: rgba(255, 255, 255, .16);
  --glass-brd: rgba(255, 255, 255, .38);
  --glass-hi: rgba(255, 255, 255, .7);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: Roboto, "Segoe UI", Arial, sans-serif;
  color: var(--ink);
  background: #f0f2f4;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select { font: inherit; color: inherit; }
.ico { width: 22px; height: 22px; fill: currentColor; }

/* --------------------------------------------------------------- hero --- */

.auth { display: flex; min-height: 520px; height: min(68vh, 620px); }

.auth__left {
  width: 50%;
  background: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 32px;
}

.auth__inner { width: 100%; max-width: 400px; }

.brand { margin-bottom: 34px; }
.brand__logo { height: 34px; width: auto; filter: brightness(0) invert(1); }

.auth__title {
  margin: 0;
  font-size: 32px; line-height: 40px; font-weight: 400;
  color: #fefefe;
}

.auth__right {
  width: 50%;
  position: relative;
  /* фон в CSS, а не инлайном: лёгкая версия на узких экранах, полная — только на десктопе */
  background: #222 center/cover no-repeat url(/of/img/hero-s.jpg);
  display: flex;
  align-items: center;
  justify-content: center;
}

@media (min-width: 861px) {
  .auth__right { background-image: url(/of/img/hero.jpg); }
}

.auth__veil {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, .30);
  backdrop-filter: blur(2px);
}

.auth__actions {
  position: relative; z-index: 2;
  display: flex; flex-direction: column; gap: 14px;
  width: min(280px, 78%);
}

/* ---------------------------------------------------------- glass btn --- */

.glass {
  background: var(--glass-bg);
  border: 1px solid var(--glass-brd);
  backdrop-filter: blur(16px) saturate(180%);
  -webkit-backdrop-filter: blur(16px) saturate(180%);
  box-shadow:
    inset 0 1px 0 var(--glass-hi),
    inset 0 -1px 0 rgba(255, 255, 255, .12),
    0 8px 24px rgba(0, 0, 0, .18);
}

/* текучий блик: ездит по кнопке и даёт «жидкое стекло» */
.glass::before {
  content: "";
  position: absolute; inset: 0;
  border-radius: inherit;
  background: linear-gradient(115deg,
    transparent 20%,
    rgba(255, 255, 255, .38) 42%,
    rgba(255, 255, 255, .08) 55%,
    transparent 70%);
  background-size: 240% 100%;
  background-position: 130% 0;
  opacity: .85;
  pointer-events: none;
  transition: background-position .55s ease;
}
.glass:hover::before { background-position: 30% 0; }

.btn {
  position: relative;
  display: flex; align-items: center; justify-content: center; gap: 12px;
  border: 0; border-radius: 999px;
  height: 46px; padding: 0 22px;
  font-size: 14px; font-weight: 500; text-transform: uppercase; letter-spacing: .3px;
  color: #fefefe; cursor: pointer;
  overflow: hidden;
  transition: transform .15s ease, box-shadow .2s ease, background-color .2s ease;
}
.btn--tg { background: var(--tg); }
.btn--tg:hover { background: var(--tg-hover); }
.btn--google { background: rgba(255, 255, 255, .2); }
.btn--google:hover { background: rgba(255, 255, 255, .3); }
.btn--google span { color: #fff; text-shadow: 0 1px 2px rgba(0, 0, 0, .35); }
.btn:active { transform: scale(.985); }
.btn .ico { flex: 0 0 auto; }
.btn--google .ico { filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25)); }

/* --------------------------------------------------------------- feed --- */

.feed { background: #f0f2f4; padding: 40px 16px 0; }
.feed__wrap { max-width: 888px; margin: 0 auto; }
.feed__title { font-size: 32px; line-height: 40px; margin: 0 0 36px; }

.post {
  background: #fff; border: 1px solid var(--line); border-radius: 6px;
  overflow: hidden; margin-bottom: 28px;
  box-shadow: 0 25px 25px rgba(0, 0, 0, .15);
}
.post__head { display: flex; align-items: center; gap: 10px; padding: 12px 16px; }
.post__ava { width: 48px; height: 48px; border-radius: 50%; background: #dff3fd; object-fit: contain; padding: 11px 5px; }
.post__who { flex: 1; display: flex; flex-direction: column; }
.post__name { font-size: 16px; font-weight: 500; display: flex; align-items: center; gap: 4px; }
.post__check { width: 15px; height: 15px; fill: var(--blue); }
.post__login, .post__date { font-size: 14px; color: var(--muted); }
.post__text { padding: 0 16px 12px; font-size: 16px; line-height: 24px; }
.post__text p { margin: 0 0 4px; }
.post__text a { color: var(--blue); }
.post__more { font-size: 14px; color: var(--blue); }
.post__media { position: relative; aspect-ratio: 16 / 9; }
.post__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.post__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(0, 0, 0, .18);
}
.post__play svg { width: 54px; height: 54px; fill: #fff; filter: drop-shadow(0 2px 6px rgba(0,0,0,.4)); }

/* --------------------------------------------------------------- foot --- */

.foot { background: #fff; margin-top: 40px; padding: 36px 16px 54px; font-size: 13px; color: var(--muted); }
.foot__wrap { max-width: 888px; margin: 0 auto; display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr 1fr; gap: 22px; }
.foot__col { display: flex; flex-direction: column; gap: 12px; }
.foot__col p { margin: 0; }
.foot__col a:hover { color: var(--blue); }
.foot__soc { display: flex; gap: 14px; }
.foot__soc svg { width: 20px; height: 20px; fill: var(--muted); }
.foot__soc a:hover svg { fill: var(--blue); }

/* -------------------------------------------------------------- modal --- */

.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 100; display: flex; align-items: center; justify-content: center; padding: 16px; }
.modal > .sheet { flex: 0 1 auto; min-width: 0; }

.modal__backdrop {
  position: absolute; inset: 0;
  background: rgba(10, 20, 30, .55);
  backdrop-filter: blur(3px);
  animation: fade .18s ease both;
}

.sheet {
  position: relative;
  width: 400px;
  max-width: calc(100vw - 32px);
  border-radius: 20px;
  padding: 26px 24px 24px;
  color: #fff;
  background: rgba(35, 45, 58, .72);
  animation: rise .22s cubic-bezier(.2, .8, .3, 1) both;
  max-height: calc(100vh - 32px);
  overflow-y: auto;
  /* каркас: пока подгружается шрифт, высота не скачет и кнопку не сдвигает */
  min-height: 300px;
}

@keyframes fade { from { opacity: 0 } }
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.98) } }

.sheet__x {
  position: absolute; top: 10px; right: 12px;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(255, 255, 255, .1); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.sheet__x:hover { background: rgba(255, 255, 255, .2); }

.sheet__head { text-align: center; margin-bottom: 18px; }
.sheet__logo {
  width: 52px; height: 52px; border-radius: 50%;
  display: inline-grid; place-items: center;
  background: var(--tg); margin-bottom: 12px;
}
.sheet__logo .ico { width: 28px; height: 28px; }
.sheet__title { margin: 0 0 6px; font-size: 19px; font-weight: 500; }
.sheet__sub { margin: 0; font-size: 13.5px; color: #b9c3cf; }

.sheet__g-head { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.sheet__g-head .ico { width: 26px; height: 26px; }
.sheet__g-head .sheet__title { margin: 0; }

.form { display: flex; flex-direction: column; gap: 10px; }
.form__cc {
  height: 46px; border-radius: 10px; padding: 0 12px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  color: #fff; appearance: none; cursor: pointer;
}
.form__cc option { color: #111; }
.form__input {
  height: 46px; border-radius: 10px; padding: 0 14px;
  background: rgba(255, 255, 255, .1); border: 1px solid rgba(255, 255, 255, .18);
  outline: none; font-size: 16px;
  transition: border-color .15s, background-color .15s;
}
.form__input::placeholder { color: #9aa6b3; }
.form__input:focus { border-color: #7fb3ff; background: rgba(255, 255, 255, .14); }

.form__lead { margin: 0; font-size: 13px; color: #b9c3cf; }
.form__hint { margin: 0; font-size: 12.5px; color: #b9c3cf; }
.form__hint.err { color: #ff9d9d; }
.form__note { margin: 2px 0 0; font-size: 12px; line-height: 16px; color: #93a0ae; }

.form__row { display: flex; justify-content: flex-end; gap: 8px; margin-top: 6px; }

.btn--primary {
  height: 44px; border-radius: 10px; background: var(--tg);
  text-transform: none; letter-spacing: 0; font-size: 15px;
}
.btn--primary:hover { background: var(--tg-hover); }
.btn--primary:disabled { opacity: .6; cursor: default; }
.btn--text {
  height: 44px; border-radius: 10px; background: transparent;
  text-transform: none; color: #cfd6de; font-size: 15px;
}
.btn--text:hover { background: rgba(255, 255, 255, .08); }

.code { letter-spacing: 8px; text-align: center; font-size: 19px; font-weight: 600; }

.spin {
  width: 15px; height: 15px; border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, .45); border-top-color: #fff;
  display: inline-block; animation: sp .7s linear infinite;
}
@keyframes sp { to { transform: rotate(360deg) } }

.sheet__ok { text-align: center; padding: 10px 0 4px; }
.sheet__ok .sheet__logo { background: #2eb872; }

/* ------------------------------------------------------------- toast --- */

.toast {
  position: fixed; z-index: 90;
  left: 50%; bottom: calc(22px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  display: flex; align-items: flex-start; gap: 12px;
  width: min(430px, calc(100vw - 32px));
  padding: 15px 14px 15px 16px;
  border-radius: 14px;
  background: rgba(28, 37, 48, .96);
  border: 1px solid rgba(255, 255, 255, .2);
  box-shadow: 0 16px 40px rgba(0, 0, 0, .45);
  backdrop-filter: blur(14px);
  color: #fff;
  animation: toastIn .28s cubic-bezier(.2, .8, .3, 1) both;
}
@keyframes toastIn { from { opacity: 0; transform: translate(-50%, 12px) } }

.toast__spinner { padding-top: 2px; }
.toast__spinner .spin { width: 17px; height: 17px; border-color: rgba(255,255,255,.3); border-top-color: #4cc9f0; }
.toast__text { display: flex; flex-direction: column; gap: 3px; flex: 1; }
.toast__text b { font-size: 14.5px; font-weight: 500; }
.toast__text span { font-size: 12.5px; line-height: 17px; color: #b9c3cf; }
.toast__x {
  border: 0; background: transparent; color: #9aa6b3; font-size: 20px; line-height: 1;
  cursor: pointer; padding: 0 2px;
}
.toast__x:hover { color: #fff; }

.toast--ok { border-color: rgba(64, 200, 130, .45); }
.toast--ok .toast__spinner .ico { width: 18px; height: 18px; fill: none; stroke: #35d07f; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.toast--out { animation: toastOut .26s ease both; }
@keyframes toastOut { to { opacity: 0; transform: translate(-50%, 10px) } }

/* -------------------------------------------------------- responsive --- */

@media (max-width: 860px) {
  .auth { flex-direction: column; height: auto; min-height: 0; }
  .auth__left, .auth__right { width: 100%; }
  .auth__left { padding: 36px 24px 44px; }
  .auth__title { font-size: 28px; line-height: 36px; }
  .auth__right { height: 46vh; min-height: 260px; }
  .auth__actions { width: min(340px, 92%); }
  .btn { padding: 0 14px; gap: 8px; font-size: 12.5px; letter-spacing: .15px; text-align: center; }
  .feed__title { font-size: 26px; line-height: 32px; margin-bottom: 24px; }
  .foot__wrap { grid-template-columns: 1fr 1fr; }
}

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