/* ================================================================
   Водолей-информ — страницы авторизации
   Login / Register / Register-Service / Forgot / Reset
   ================================================================ */

/* ================= Шрифты ================= */
@font-face {
  font-family: 'AttractiveCond';
  src: url('/fonts/AttractiveCond-Medium.woff2') format('woff2');
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}

html {
  font-size: 130%;
}

   /* ---------- Базовая раскладка ---------- */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'AttractiveCond', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  background:
    radial-gradient(ellipse at 20% 10%, rgba(94, 180, 255, .35), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0, 119, 182, .5), transparent 60%),
    linear-gradient(180deg, #0a2540 0%, #0d3a63 40%, #0a2c4d 100%);
  position: relative;
  color: #1e293b;
  -webkit-font-smoothing: antialiased;
}

/* Вариант для service-регистрации — бирюзовая палитра */
body.auth-service {
  background:
    radial-gradient(ellipse at 20% 10%, rgba(0, 220, 200, .30), transparent 60%),
    radial-gradient(ellipse at 80% 90%, rgba(0, 140, 160, .5), transparent 60%),
    linear-gradient(180deg, #062a2f 0%, #0a4247 40%, #08303a 100%);
}

/* ---------- Волны на фоне ---------- */
.waves {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
}
.wave {
  position: absolute;
  left: 0;
  width: 200%;
  height: 220px;
  bottom: -20px;
  background-repeat: repeat-x;
  background-size: 50% 100%;
  opacity: .55;
  animation: waveMove 24s linear infinite;
  will-change: transform;
}
.wave.w1 {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'>\
<path fill='%230c4a7a' d='M0,120 C200,60 400,180 600,120 C800,60 1000,180 1200,120 L1200,200 L0,200 Z'/>\
</svg>");
  animation-duration: 28s;
  opacity: .35;
}
.wave.w2 {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'>\
<path fill='%231067a3' d='M0,140 C250,80 450,200 700,140 C950,80 1100,180 1200,140 L1200,200 L0,200 Z'/>\
</svg>");
  animation-duration: 20s;
  animation-direction: reverse;
  opacity: .45;
}
.wave.w3 {
  background-image: url("data:image/svg+xml;utf8,\
<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 1200 200' preserveAspectRatio='none'>\
<path fill='%231a7fbf' d='M0,160 C300,110 500,210 800,160 C1000,120 1150,190 1200,160 L1200,200 L0,200 Z'/>\
</svg>");
  animation-duration: 16s;
  opacity: .6;
}

/* Для service — другие волны */
body.auth-service .wave.w1 path { fill: #084a4f; }
body.auth-service .wave.w2 path { fill: #0a6a72; }
body.auth-service .wave.w3 path { fill: #1a9fa8; }

@keyframes waveMove {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* ---------- Пузырьки ---------- */
.bubbles {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
  z-index: 1;
}
.bubble {
  position: absolute;
  bottom: -60px;
  background: radial-gradient(circle at 30% 30%, rgba(255,255,255,.85), rgba(255,255,255,.05) 70%);
  border-radius: 50%;
  animation: rise linear infinite;
  opacity: .5;
}
@keyframes rise {
  0%   { transform: translateY(0) translateX(0) scale(1); opacity: 0; }
  10%  { opacity: .6; }
  100% { transform: translateY(-110vh) translateX(40px) scale(1.1); opacity: 0; }
}

/* ---------- Карточка ---------- */
.auth-card {
  position: relative;
  z-index: 5;
  width: 380px;
  max-width: calc(100vw - 32px);
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  padding: 36px 34px 30px;
  border-radius: 20px;
  background: rgba(255, 255, 255, .97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow:
    0 20px 60px rgba(0, 20, 40, .45),
    0 0 0 1px rgba(255, 255, 255, .5) inset;
  animation: cardIn .35s ease;
}

@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px) scale(.98); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

.auth-card.wide { width: 440px; }   /* для register-service */

/* ---------- Логотип ---------- */
.auth-logo {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  margin-bottom: 4px;
}

/* Логотип-картинка — крупный */
.auth-logo-img {
  display: block;
  width: 208px;
  max-width: 100%;
  height: auto;
  margin-bottom: 2px;
}

/* Слово «информ» под логотипом */
.auth-logo-suffix {
  font-weight: 700;
  font-size: 1.1875rem;
  letter-spacing: .8px;
  color: #00A3E4;
  text-transform: lowercase;
  margin-bottom: 8px;
}

/* Для service-регистрации — бирюзовый цвет */
body.auth-service .auth-logo-suffix {
  color: #14b8a6;
}

/* Адаптив: на маленьких экранах логотип меньше */
@media (max-width: 480px) {
  .auth-logo-img {
    width: 176px;
  }
  .auth-logo-suffix {
    font-size: 17.7px;
  }
}

.auth-card h1 {
  font-size: 1.25rem;
  margin: 0;
  text-align: center;
  color: #0a2540;
  letter-spacing: -.3px;
  font-weight: 800;
}
.auth-card .sub {
  text-align: center;
  color: #6b7a8c;
  ;
  margin: 6px 0 22px;
  line-height: 1.5;
}

/* ---------- Поля ---------- */
.auth-card input {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1.5px solid #d0dae5;
  background: #f8fafc;
  color: #1e293b;
  transition: border-color .15s, box-shadow .15s, background .15s;
  box-sizing: border-box;
}
.auth-card input::placeholder { color: #94a9bd; }

.auth-card input:focus {
  outline: none;
  border-color: #2196f3;
  background: #fff;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, .15);
}

body.auth-service .auth-card input:focus {
  border-color: #14b8a6;
  box-shadow: 0 0 0 4px rgba(20, 184, 166, .15);
}

.auth-card select {
  width: 100%;
  margin-bottom: 10px;
  padding: 12px 14px;
  font-size: 0.875rem;
  font-family: inherit;
  border-radius: 10px;
  border: 1.5px solid #d0dae5;
  background: #f8fafc;
  color: #1e293b;
  cursor: pointer;
  box-sizing: border-box;
}
.auth-card select:focus {
  outline: none;
  border-color: #2196f3;
  box-shadow: 0 0 0 4px rgba(33, 150, 243, .15);
}

.auth-card label {
  display: block;
  font-size: 0.78125rem;
  color: #6b7a8c;
  margin: 4px 0 4px;
  font-weight: 500;
}

/* ---------- Кнопка ---------- */
.auth-card button[type="submit"] {
  width: 100%;
  padding: 13px;
  font-size: 0.9375rem;
  font-weight: 700;
  font-family: inherit;
  border-radius: 10px;
  border: none;
  color: #fff;
  background: linear-gradient(135deg, #2196f3, #1565c0);
  cursor: pointer;
  transition: transform .08s, box-shadow .15s, filter .15s;
  box-shadow: 0 6px 16px rgba(21, 101, 192, .35);
  margin-top: 6px;
  letter-spacing: .2px;
}
.auth-card button[type="submit"]:hover:not(:disabled) {
  filter: brightness(1.05);
  box-shadow: 0 8px 20px rgba(21, 101, 192, .45);
}
.auth-card button[type="submit"]:active:not(:disabled) {
  transform: translateY(1px);
}
.auth-card button[type="submit"]:disabled {
  filter: grayscale(.4) brightness(.9);
  cursor: not-allowed;
  box-shadow: none;
}

body.auth-service .auth-card button[type="submit"] {
  background: linear-gradient(135deg, #14b8a6, #0d9488);
  box-shadow: 0 6px 16px rgba(13, 148, 136, .35);
}
body.auth-service .auth-card button[type="submit"]:hover:not(:disabled) {
  box-shadow: 0 8px 20px rgba(13, 148, 136, .45);
}

/* ---------- Подсказка ---------- */
.auth-card .hint {
  font-size: 0.71875rem;
  color: #0d47a1;
  background: #e3f2fd;
  padding: 9px 13px;
  border-radius: 9px;
  border-left: 3px solid #2196f3;
  margin-bottom: 14px;
  line-height: 1.55;
}

body.auth-service .auth-card .hint {
  color: #0a6a72;
  background: #e6f7f5;
  border-left-color: #14b8a6;
}

/* ---------- Сообщения об ошибках ---------- */
.auth-card .error {
  color: #a02020;
  background: #fde7e7;
  padding: 10px 14px;
  border-radius: 9px;
  ;
  margin-bottom: 12px;
  display: none;
  text-align: center;
  line-height: 1.5;
}
.auth-card .success {
  color: #1a6b2a;
  background: #e3f6e5;
  padding: 10px 14px;
  border-radius: 9px;
  ;
  margin-bottom: 12px;
  display: none;
  text-align: center;
  line-height: 1.5;
}

/* ---------- Ссылка внизу ---------- */
.auth-card .login-link {
  text-align: center;
  ;
  color: #555;
  margin-top: 16px;
  line-height: 1.8;
}
.auth-card .login-link a {
  color: #1565c0;
  text-decoration: none;
  font-weight: 600;
}
.auth-card .login-link a:hover { text-decoration: underline; }

body.auth-service .auth-card .login-link a { color: #0d9488; }

/* ---------- Captcha ---------- */
.auth-card .captcha-wrap {
  margin: 12px 0 4px;
}
.auth-card .captcha-wrap .smart-captcha {
  min-height: 80px;
}

/* ---------- Адаптив для мобильных ---------- */
@media (max-width: 480px) {
  html, body { overflow: auto; }
  body { padding: 20px 0; align-items: flex-start; }

  .auth-card {
    width: calc(100vw - 24px);
    padding: 28px 22px 24px;
    border-radius: 16px;
    margin: 20px auto;
  }
  .auth-card.wide { width: calc(100vw - 24px); }

  .auth-logo-icon { width: 46px; height: 46px; }
  .auth-logo-icon svg { width: 26px; height: 26px; }
  .auth-card h1 { font-size: 1.125rem; }
  .auth-card .sub { font-size: 0.78125rem; margin-bottom: 18px; }
  .auth-card input,
  .auth-card select { padding: 11px 13px; font-size: 0.875rem; }
}

/* ================= Ссылка «Регистрация сервиса» — бирюзовая ================= */
/* В login.html эта ссылка должна отличаться от обычной регистрации владельца */

.auth-card .login-link a.service-link,
.auth-card a.service-link {
  color: #0d9488;
  font-weight: 600;
}
.auth-card .login-link a.service-link:hover,
.auth-card a.service-link:hover {
  color: #0a6a72;
}

/* ================= Водяные знаки с логотипом ================= */
/* Паттерн из мелких логотипов, «раскиданных» по экрану. */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.16;
  mix-blend-mode: screen;

  background-image:
    url('/logo.svg'), url('/logo.svg'), url('/logo.svg'),
    url('/logo.svg'), url('/logo.svg'), url('/logo.svg'),
    url('/logo.svg'), url('/logo.svg'), url('/logo.svg'),
    url('/logo.svg'), url('/logo.svg'), url('/logo.svg');

  background-repeat: no-repeat;

  background-position:
     5%  10%, 25%  35%, 45%  15%,
    65%  40%, 85%  20%, 15%  65%,
    35%  85%, 55%  60%, 75%  80%,
    90%  65%, 10%  90%, 50%  40%;

  background-size:
    180px 135px, 210px 150px, 150px 120px,
    195px 142px, 165px 127px, 187px 138px,
    157px 117px, 202px 147px, 172px 132px,
    195px 142px, 150px 112px, 225px 165px;

  filter: blur(0.4px) brightness(1.8) saturate(0.9);
}

@media (max-width: 700px) {
  body::before {
    opacity: 0.12;
    background-size:
      110px 82px, 130px 98px, 100px 75px,
      120px 90px, 105px 79px, 115px 86px,
      100px 75px, 125px 94px, 110px 82px,
      120px 90px, 100px 75px, 140px 105px;
  }
}