/* ==========================
   Подключение шрифта Philosopher
   ========================== */
@import url('https://fonts.googleapis.com/css2?family=Philosopher:wght@400;700&display=swap');

/* ==========================
   ОСНОВНОЙ СТИЛЬ
   ========================== */
.cmt h3 {
  font-family: 'Philosopher', sans-serif;
  font-size: 20px;
  font-weight: 700;
  color: #111827;
  text-align: center;
}

.cmt label {
  display: block;
  font-weight: 500;
  color: #374151;
  text-align: left;
  margin: 0 0 5px 5px;
}

.cmt input[type="text"],
.cmt input[type="password"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #9ca3af;
  border-radius: 8px;
  background-color: #fff;
  font-size: 15px;
  color: #111827;
  margin-bottom: 12px;
  box-sizing: border-box;
  transition: border 0.2s, box-shadow 0.2s;
}

.cmt input[type="text"]:focus,
.cmt input[type="password"]:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.2);
  outline: none;
}

.cmt input[type="submit"] {
  display: block;
  width: 100%;
  max-width: 200px;
  margin: 10px auto 0;
  font-family: 'Philosopher', sans-serif;
  font-weight: 700;
  background: #0D2056;
  color: #fff;
  border: 2px solid #BFE2FF;
  border-radius: 6px;
  padding: 6px 10px;
  cursor: pointer;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: background 0.2s, transform 0.1s;
}

.cmt input[type="submit"]:hover {
  background: #0D2056;
  transform: scale(1.03);
}

.version-info {
  margin-top: 15px;
  text-align: right;
  font-size: 13px;
  color: #6b7280;
}

/* ==========================
   КНОПКА ЗАКРЫТИЯ
   ========================== */
.close-btn {
  position: absolute;
  top: 10px;
  right: 12px;
  background: none;
  border: none;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  transition: color 0.2s;
}
.close-btn:hover {
  color: #000;
}

/* ==========================
   АДАПТАЦИЯ
   ========================== */
@media (max-width: 768px) {
  .cmt h3 { font-size: 17px; }
  .cmt input[type="text"],
  .cmt input[type="password"] {
    font-size: 14px;
    padding: 8px 10px;
  }
  .cmt input[type="submit"] {
    max-width: 180px;
    font-size: 13px;
    padding: 6px 8px;
  }
}

@media (max-width: 480px) {
  .cmt { padding: 10px; }
  .cmt h3 {
    font-size: 16px;
    margin-bottom: 8px;
  }
  .cmt input[type="text"],
  .cmt input[type="password"] {
    font-size: 13px;
    padding: 7px 9px;
  }
  .cmt input[type="submit"] {
    max-width: 160px;
    font-size: 12px;
    padding: 5px 8px;
  }
  .version-info {
    text-align: center;
    font-size: 12px;
  }
}

/* ==========================
   МОДАЛЬНОЕ ОКНО CSS
   ========================== */
.css-modal-details {
  height: 25px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.css-modal-details summary {
  display: inline-flex;
  margin-top: -4px;
  text-decoration: none;
  position: relative;
  font-size: 14px;
  line-height: 20px;
  padding: 2px 20px;
  color: #fff;
  font-weight: bold;
  text-transform: uppercase;
  background: #0D2056;
  cursor: pointer;
  border: 2px solid #BFE2FF;
  overflow: hidden;
  z-index: 1;
  border-radius: 5px;
}

.css-modal-details summary:before {
  content: '';
  position: absolute;
  top: 0;
  right: -50px;
  bottom: 0;
  left: 0;
  border-right: 50px solid transparent;
  border-top: 50px solid #2D6B9F;
  transition: transform 0.5s;
  transform: translateX(-100%);
  z-index: -1;
}
.css-modal-details summary:hover:before {
  transform: translateX(0);
}

/* При открытии */
.css-modal-details details[open] summary {
  cursor: default;
  opacity: 0;
  position: fixed;
  inset: 0;
  z-index: 3;
  width: 100%;
  height: 100%;
}

/* Фон затемнения */
.css-modal-details details .cmc {
  display: flex;
  align-items: center;
  justify-content: center;
}
.css-modal-details details[open] .cmc {
  pointer-events: none;
  z-index: 4;
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  animation: bg 0.5s ease;
  background: rgba(51, 122, 183, 0.7);
}
/* Убираем жёлтый фон автозаполнения в Firefox и Chrome */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  background-color: #fff !important;
  -webkit-box-shadow: 0 0 0px 1000px #fff inset !important;
  -webkit-text-fill-color: #000 !important;
  transition: background-color 5000s ease-in-out 0s;
}

.cmt input[type="text"]:focus,
.cmt input[type="password"]:focus {
  background-color: #f9fafb;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.15);
  outline: none;
}
input:-moz-autofill {
  background-color: #fff !important;
  box-shadow: 0 0 0px 1000px #fff inset !important;
  -moz-text-fill-color: #000 !important;
}
/* Плавное изменение фона при фокусе */
.cmt input[type="text"],
.cmt input[type="password"] {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}
/* Окно */
.css-modal-details details .cmt {
  font-family: 'Philosopher', sans-serif;
  padding: 10px 20px 10px 20px;
  width: 100%;
  max-width: 450px;
  max-height: 70%;
  transition: 0.5s;
  border: 6px solid #BFE2FF;
  border-radius: 12px;
  background: #FFF;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 16px 20px rgba(0,0,0,0.2);
  text-align: center;
  overflow: auto;
  color: #000;
}
.css-modal-details details[open] .cmt {
  animation: scale 0.5s ease;
  z-index: 4;
  pointer-events: auto;
}

/* Крестик */
.css-modal-details details[open] .cmc:after {
  content: "";
  width: 50px;
  height: 50px;
  border: 6px solid #BFE2FF;
  border-radius: 12px;
  position: absolute;
  z-index: 10;
  top: 20px;
  right: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.2), 0 16px 20px rgba(0,0,0,0.2);
  background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23337AB7' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3e%3cline x1='18' y1='6' x2='6' y2='18'%3e%3c/line%3e%3cline x1='6' y1='6' x2='18' y2='18'%3e%3c/line%3e%3c/svg%3e");
  background-color: #FFF;
  background-size: cover;
  animation: move 0.5s ease;
}
