@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@700&family=Source+Sans+3:wght@400;500;600&display=swap');

:root {
  --blue-deep: #2c4a6e;
  --blue-muted: #3d5f8a;
  --blue-light: #e8eef5;
  --blue-wash: #f4f7fb;
  --pumpkin: #c8652a;
  --pumpkin-light: #e8854a;
  --pumpkin-glow: rgba(200, 101, 42, 0.15);
  --text-primary: #1a2b3d;
  --text-secondary: #5a6d7f;
  --white: #ffffff;
  --shadow-soft: 0 8px 32px rgba(44, 74, 110, 0.12);
  --shadow-card: 0 16px 48px rgba(44, 74, 110, 0.18), 0 2px 8px rgba(0,0,0,0.06);
  --radius: 16px;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

.login-page {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Source Sans 3', sans-serif;
  background: var(--blue-deep);
  background-image:
    radial-gradient(ellipse at 20% 50%, rgba(61, 95, 138, 0.6) 0%, transparent 50%),
    radial-gradient(ellipse at 80% 20%, rgba(200, 101, 42, 0.08) 0%, transparent 40%),
    radial-gradient(ellipse at 60% 80%, rgba(44, 74, 110, 0.4) 0%, transparent 50%);
  position: relative;
  overflow: hidden;
  padding: 24px;
}

/* Декоративная геометрия на фоне */
.login-page::before {
  content: '';
  position: absolute;
  top: -120px;
  right: -80px;
  width: 400px;
  height: 400px;
  border: 2px solid rgba(200, 100, 42, 0.414);
  border-radius: 50%;
  animation: float 20s ease-in-out infinite;
  
}

.login-page::after {
  content: '';
  position: absolute;
  bottom: -60px;
  left: -40px;
  width: 240px;
  height: 240px;
  border: 2px solid rgba(200, 100, 42, 0.414);
  border-radius: 50%;
  animation: float 15s ease-in-out infinite reverse;
}

@keyframes float {
  0%, 100% { transform: translate(0, 0) rotate(0deg); }
  50% { transform: translate(20px, -15px) rotate(3deg); }
}

/* Карточка */
.login-first-card {
  display:flex; 
  flex-direction:column; 
  align-items:center; 
  min-width: 100%;
}

.login-card {
  width: 100%;
  max-width: 600px;
  background: var(--white);
  border-radius: var(--radius);
  padding: 48px 40px;
  box-shadow: var(--shadow-card);
  position: relative;
  z-index: 1;
  animation: cardReveal 0.7s cubic-bezier(0.22, 1, 0.36, 1) forwards;
  opacity: 0;
  transform: translateY(20px);
}

@keyframes cardReveal {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Оранжевый акцент сверху карточки */
.login-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 40px;
  right: 40px;
  height: 4px;
  background: linear-gradient(90deg, var(--pumpkin), var(--pumpkin-light));
  border-radius: 0 0 4px 4px;
}

/* Декоративная лапка — тонкий ветеринарный штрих */
.login-card::after {
  content: '🐾';
  position: absolute;
  top: 20px;
  right: 28px;
  font-size: 65px;
  opacity: 0.25;
  animation: pawFade 0.9s 0.5s ease forwards;
  opacity: 0;
}

@keyframes pawFade {
  to { opacity: 0.25; }
}

/* Заголовок */
.login-card h1 {
  font-family: 'Playfair Display', serif;
  font-size: 2rem;
  color: var(--blue-deep);
  letter-spacing: -0.5px;
  margin-bottom: 4px;
}

.login-card > p {
  font-size: 0.95rem;
  color: var(--text-secondary);
  font-weight: 500;
  margin-bottom: 32px;
}

/* Форма */
.login-card form {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.login-card input[type="text"],
.login-card input[type="password"] {
  width: 100%;
  padding: 14px 18px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-primary);
  background: var(--blue-wash);
  border: 1.5px solid transparent;
  border-radius: 10px;
  outline: none;
  transition: all 0.25s ease;
}

.login-card input::placeholder {
  color: var(--text-secondary);
  font-weight: 400;
}

.login-card input:focus {
  background: var(--white);
  border-color: var(--blue-muted);
  box-shadow: 0 0 0 4px rgba(61, 95, 138, 0.1);
}

/* Кнопка */
.login-card button[type="submit"] {
  margin-top: 8px;
  padding: 15px 24px;
  font-family: 'Source Sans 3', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  color: var(--white);
  background: linear-gradient(135deg, var(--pumpkin) 0%, var(--pumpkin-light) 100%);
  border: none;
  border-radius: 10px;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.3s ease;
  box-shadow: 0 4px 16px var(--pumpkin-glow);
}

.login-card button[type="submit"]:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(200, 101, 42, 0.3);
}

.login-card button[type="submit"]:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px var(--pumpkin-glow);
}

/* Ripple-эффект на кнопке */
.login-card button[type="submit"]::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.login-card button[type="submit"]:hover::after {
  opacity: 1;
}

/* Ошибка */
.error-box {
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #b91c1c;
  font-size: 0.88rem;
  font-weight: 500;
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 20px;
  animation: shake 0.4s ease;
}

@keyframes shake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

/* ===== Мобильная адаптация ===== */

@media (max-width: 480px) {
  .login-page {
    padding: 16px;
    align-items: flex-start;
    padding-top: 15vh;
  }

  .login-card {
    padding: 36px 24px;
    border-radius: 12px;
  }

  .login-card::before {
    left: 24px;
    right: 24px;
  }

  .login-card h1 {
    font-size: 1.7rem;
  }

  .login-card input[type="text"],
  .login-card input[type="password"] {
    padding: 13px 16px;
  }

  .login-page::before {
    width: 250px;
    height: 250px;
    top: -80px;
    right: -60px;
  }

  .login-page::after {
    width: 150px;
    height: 150px;
  }
}

@media (max-width: 360px) {
  .login-card {
    padding: 28px 20px;
  }

  .login-card h1 {
    font-size: 1.5rem;
  }
}

/* Тёмная тема для предпочитающих */
@media (prefers-color-scheme: dark) {
  .login-card {
    background: #1e293b;
    box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
  }

  .login-card h1 {
    color: var(--blue-light);
  }

  .login-card > p {
    color: #94a3b8;
  }

  .login-card input[type="text"],
  .login-card input[type="password"] {
    background: #2d3a4d;
    color: #e2e8f0;
    border-color: transparent;
  }

  .login-card input:focus {
    background: #1e293b;
    border-color: var(--blue-muted);
    box-shadow: 0 0 0 4px rgba(61, 95, 138, 0.2);
  }

  .login-card input::placeholder {
    color: #64748b;
  }

  .error-box {
    background: #3b1a1a;
    border-color: #7f1d1d;
    color: #fca5a5;
  }
}

/* ===== Котик поверх карточки ===== */
.login-cat {
    position: absolute;
    top: 45px;
    right: 300px;
    width: 150px;
    height: 90px;
    z-index: 10;
    cursor: pointer;
    transition: transform 0.3s ease;
  }
  
  /* Эффект при наведении на котика */
  .login-cat:hover {
    transform: scale(1.05) rotate(2deg);
  }
  
  /* Адаптация для мобильных */
  @media (max-width: 480px) {
    .login-cat {
      width: 120px;
      height: 70px;
      right: 10px;
    }
  }
  
  @media (max-width: 360px) {
    .login-cat {
      width: 60px;
      height: 60px;
      top: -25px;
      right: 10px;
    }
  }
  
  /* Анимация появления котика */
  @keyframes catAppear {
    0% {
      opacity: 0;
      transform: translateY(-20px) scale(0.8);
    }
    100% {
      opacity: 1;
      transform: translateY(0) scale(1);
    }
  }
  
  .login-cat {
    animation: catAppear 0.5s 0.3s ease backwards;
  }

  /* ─── фоновые иконки-водяные знаки ─── */

.bg-icons {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.bg-icon {
  position: absolute;
  opacity: 0.055;
  filter: brightness(0) invert(1);
  animation: bgIconFloat linear infinite;
}

@keyframes bgIconFloat {
  0%   { transform: translateY(0px)   rotate(var(--r, 0deg)); }
  50%  { transform: translateY(-14px) rotate(var(--r, 0deg)); }
  100% { transform: translateY(0px)   rotate(var(--r, 0deg)); }
}