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

html,
body {
  width: 100%;
  overflow-x: hidden;
}

body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}

.login-wrapper {
  width: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.login-card {
  background: white;
  border-radius: 28px;
  box-shadow: 0 20px 40px rgba(255, 107, 53, 0.15);
  border-top: 6px solid #ff6b35;
  transition: all 0.3s ease;
  overflow: hidden;
}

.login-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 25px 50px rgba(255, 107, 53, 0.2);
}

.card-body {
  padding: 40px 35px;
}

.logo {
  text-align: center;
  margin-bottom: 30px;
}

.logo img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 4px solid #ff6b35;
  padding: 6px;
  transition: all 0.3s ease;
  object-fit: cover;
  background: white;
}

.logo img:active {
  transform: scale(0.95);
}

.logo h2 {
  color: #ff6b35;
  font-weight: 700;
  font-size: 26px;
  margin-top: 16px;
  line-height: 1.3;
}

.logo p {
  color: #6c757d;
  font-size: 15px;
  margin-top: 8px;
}

.language-selector {
  display: flex;
  justify-content: center;
  gap: 12px;
  margin-bottom: 25px;
  flex-wrap: wrap;
}

.lang-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 20px;
  border: 2px solid #dee2e6;
  border-radius: 50px;
  background: white;
  color: #495057;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
  cursor: pointer;
  text-decoration: none;
}

.lang-btn i {
  font-size: 16px;
}

.lang-btn:hover {
  border-color: #ff6b35;
  background: rgba(255, 107, 53, 0.05);
  transform: translateY(-2px);
}

.lang-btn.active {
  background: #ff6b35;
  border-color: #ff6b35;
  color: white;
}

.lang-btn.active i {
  color: white;
}

.form-group {
  position: relative;
  margin-bottom: 30px;
}

.form-control {
  border-radius: 16px;
  padding: 18px 20px;
  border: 2px solid #e9ecef;
  transition: all 0.3s ease;
  font-size: 16px;
  width: 100%;
  background: white;
  height: auto;
}

.form-control:hover {
  border-color: #ffb733;
}

.form-control:focus {
  border-color: #ff6b35;
  box-shadow: 0 0 0 4px rgba(255, 107, 53, 0.1);
  outline: none;
}

.form-label {
  position: absolute;
  left: 16px;
  color: #6c757d;
  font-size: 16px;
  pointer-events: none;
  transition: all 0.2s ease;
  background: white;
  padding: 0 8px;
  top: 50%;
  transform: translateY(-50%);
}

.form-control:focus + .form-label,
.form-control:not(:placeholder-shown) + .form-label {
  top: -10px;
  font-size: 13px;
  color: #ff6b35;
  background: white;
  transform: translateY(0);
}

.password-toggle {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: #6c757d;
  cursor: pointer;
  padding: 10px;
  transition: all 0.2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.password-toggle:hover {
  color: #ff6b35;
  transform: translateY(-50%) scale(1.1);
}

.password-toggle:active {
  transform: translateY(-50%) scale(0.95);
}

/* ========== КНОПКА ВХОДА ========== */
.btn-login {
  background: linear-gradient(135deg, #ff6b35, #e55a2b);
  border: none;
  border-radius: 16px;
  padding: 16px 30px;
  font-weight: 700;
  font-size: 18px;
  color: white;
  width: 100%;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  position: relative;
  overflow: hidden;
}

.btn-login::before {
  content: "";
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(
    90deg,
    transparent,
    rgba(255, 255, 255, 0.2),
    transparent
  );
  transition: left 0.7s ease;
}

.btn-login:hover::before {
  left: 100%;
}

.btn-login:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 25px rgba(255, 107, 53, 0.4);
}

.btn-login:active {
  transform: translateY(-1px);
}

.btn-login i {
  font-size: 18px;
}

/* ========== ССЫЛКА НА РЕГИСТРАЦИЮ ========== */
.register-link {
  text-align: center;
  margin-top: 25px;
  color: #6c757d;
  font-size: 15px;
}

.register-link a {
  color: #ff6b35;
  text-decoration: none;
  font-weight: 600;
  transition: all 0.3s ease;
  position: relative;
  padding-bottom: 2px;
}

.register-link a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background: #ff6b35;
  transition: width 0.3s ease;
}

.register-link a:hover::after {
  width: 100%;
}

.alert {
  border-radius: 16px;
  margin-bottom: 25px;
  padding: 16px 20px;
  border: none;
  font-weight: 500;
  animation: slideIn 0.4s ease-out;
}

@keyframes slideIn {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

.alert-danger {
  background: linear-gradient(135deg, #fff5f5, #ffe3e3);
  color: #c92a2a;
  border-left: 5px solid #dc3545;
}

.alert ul {
  margin-bottom: 0;
  padding-left: 20px;
}

.a11y-fab {
  position: fixed;
  right: 20px;
  bottom: 20px;
  z-index: 9999;
}

.a11y-fab button {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #ff6b35, #e55a2b);
  color: white;
  border: 3px solid white;
  font-size: 24px;
  box-shadow: 0 8px 25px rgba(255, 107, 53, 0.5);
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.a11y-fab button:active {
  transform: scale(0.9);
}

.a11y-panel {
  position: fixed;
  right: 90px;
  bottom: 20px;
  width: 350px;
  max-width: calc(100vw - 40px);
  background: white;
  border: 3px solid #ff6b35;
  border-radius: 24px;
  padding: 25px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.25);
  z-index: 9998;
  display: none;
}

.a11y-panel.open {
  display: block;
  animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.a11y-panel h3 {
  color: #ff6b35;
  font-size: 1.2rem;
  font-weight: 700;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 2px solid #ff6b35;
  padding-bottom: 15px;
}

.a11y-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 15px;
}

.a11y-row button,
.a11y-row select {
  border: 2px solid #ff6b35;
  background: white;
  padding: 12px 16px;
  border-radius: 14px;
  font-weight: 600;
  font-size: 14px;
  color: #333;
  cursor: pointer;
  transition: all 0.2s ease;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.a11y-row button:active,
.a11y-row select:active {
  transform: scale(0.95);
}

.a11y-row button[aria-pressed="true"] {
  background: #ff6b35;
  color: white;
}

body.a11y-on {
  font-family: Arial, Helvetica, sans-serif !important;
  line-height: 1.8 !important;
}

body.a11y-font-100 {
  font-size: 16px !important;
}
body.a11y-font-150 {
  font-size: 20px !important;
}
body.a11y-font-200 {
  font-size: 24px !important;
}

body.a11y-spacing * {
  line-height: 2.2 !important;
  letter-spacing: 0.08em !important;
  word-spacing: 0.15em !important;
}

body.a11y-noimg img {
  display: none !important;
}

body.a11y-theme-bw {
  background: white !important;
  color: black !important;
}
body.a11y-theme-wb {
  background: black !important;
  color: white !important;
}
body.a11y-theme-blue {
  background: #0a3144 !important;
  color: #e6f3ff !important;
}
body.a11y-theme-brown {
  background: #3b2b22 !important;
  color: #ffecd9 !important;
}
body.a11y-theme-gray {
  background: #f0f0f0 !important;
  color: #222 !important;
}

@media (max-width: 576px) {
  body {
    padding: 12px;
    align-items: flex-start;
    padding-top: 30px;
  }

  .card-body {
    padding: 30px 20px;
  }

  .logo img {
    width: 85px;
    height: 85px;
  }

  .logo h2 {
    font-size: 22px;
  }

  .logo p {
    font-size: 14px;
  }

  .language-selector {
    gap: 8px;
  }

  .lang-btn {
    padding: 8px 16px;
    font-size: 14px;
  }

  .lang-btn i {
    font-size: 14px;
  }

  .form-control {
    padding: 16px 16px;
    font-size: 15px;
  }

  .form-label {
    font-size: 15px;
  }

  .btn-login {
    padding: 14px 20px;
    font-size: 16px;
  }

  .a11y-panel {
    right: 20px;
    left: 20px;
    bottom: 90px;
    width: auto;
    padding: 20px;
  }

  .a11y-fab button {
    width: 55px;
    height: 55px;
    font-size: 22px;
  }

  .a11y-row button,
  .a11y-row select {
    padding: 10px 12px;
    font-size: 13px;
  }
}

@media (max-width: 360px) {
  .card-body {
    padding: 25px 16px;
  }

  .logo img {
    width: 75px;
    height: 75px;
  }

  .logo h2 {
    font-size: 20px;
  }

  .lang-btn {
    padding: 7px 12px;
    font-size: 13px;
  }

  .language-selector {
    gap: 6px;
  }
}

@media (hover: none) {
  .lang-btn:hover,
  .btn-login:hover,
  .password-toggle:hover,
  .a11y-fab button:hover,
  .a11y-row button:hover {
    transform: none;
  }

  .lang-btn:active,
  .btn-login:active,
  .password-toggle:active,
  .a11y-fab button:active,
  .a11y-row button:active {
    transform: scale(0.95);
  }
}

:focus-visible {
  outline: 3px solid #ff6b35 !important;
  outline-offset: 3px !important;
}
