/* auth-gate.css
   Стартовое окно авторизации для АИС теплицы.
   Подключается поверх текущего сайта и не требует изменения серверной логики.
*/

:root {
  --auth-bg-1: #07130d;
  --auth-bg-2: #123821;
  --auth-card: rgba(9, 24, 16, 0.88);
  --auth-card-border: rgba(186, 255, 210, 0.16);
  --auth-text: #f2fff6;
  --auth-muted: rgba(242, 255, 246, 0.68);
  --auth-green: #63d987;
  --auth-green-dark: #1f8a48;
  --auth-danger: #ff7777;
  --auth-line: rgba(255, 255, 255, 0.18);
}

.auth-gate {
  position: fixed;
  inset: 0;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  color: var(--auth-text);
  background:
    radial-gradient(circle at 18% 18%, rgba(99, 217, 135, 0.26), transparent 30%),
    radial-gradient(circle at 84% 82%, rgba(42, 157, 92, 0.34), transparent 36%),
    linear-gradient(135deg, var(--auth-bg-1), var(--auth-bg-2));
  overflow: hidden;
}

.auth-gate::before,
.auth-gate::after {
  content: "";
  position: absolute;
  left: -8%;
  right: -8%;
  height: 190px;
  border-radius: 50%;
  opacity: 0.32;
  pointer-events: none;
}

.auth-gate::before {
  bottom: -84px;
  background: linear-gradient(90deg, rgba(44, 148, 83, 0.6), rgba(116, 232, 143, 0.32));
  transform: rotate(-4deg);
}

.auth-gate::after {
  bottom: -112px;
  background: linear-gradient(90deg, rgba(21, 77, 44, 0.78), rgba(71, 192, 105, 0.38));
  transform: rotate(4deg);
}

.auth-gate__card {
  position: relative;
  width: min(420px, 100%);
  min-height: 560px;
  padding: 44px 42px 30px;
  border: 1px solid var(--auth-card-border);
  border-radius: 18px;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.06), transparent 42%),
    var(--auth-card);
  box-shadow: 0 26px 90px rgba(0, 0, 0, 0.42);
  backdrop-filter: blur(16px);
  overflow: hidden;
}

.auth-gate__brand {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 34px;
  text-align: center;
}

.auth-gate__logo {
  width: 112px;
  height: 112px;
  margin-bottom: 18px;
  filter: drop-shadow(0 16px 28px rgba(45, 201, 101, 0.28));
}

.auth-gate__title {
  margin: 0;
  font-size: 22px;
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.02em;
}

.auth-gate__subtitle {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--auth-muted);
}

.auth-gate__form {
  display: grid;
  gap: 18px;
}

.auth-gate__field {
  position: relative;
  display: grid;
  grid-template-columns: 28px 1fr;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--auth-line);
}

.auth-gate__field:focus-within {
  border-bottom-color: rgba(99, 217, 135, 0.86);
}

.auth-gate__icon {
  width: 21px;
  height: 21px;
  color: var(--auth-green);
  opacity: 0.95;
}

.auth-gate__input {
  width: 100%;
  min-width: 0;
  padding: 14px 0 12px;
  border: 0;
  outline: 0;
  color: var(--auth-text);
  background: transparent;
  font-size: 15px;
  line-height: 1.2;
}

.auth-gate__input::placeholder {
  color: rgba(242, 255, 246, 0.48);
}

.auth-gate__button {
  margin-top: 14px;
  width: 100%;
  padding: 14px 18px;
  border: 0;
  border-radius: 999px;
  color: #06200f;
  background: linear-gradient(135deg, var(--auth-green), #b8f7a1);
  box-shadow: 0 14px 26px rgba(70, 205, 109, 0.22);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, opacity 0.16s ease;
}

.auth-gate__button:hover {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(70, 205, 109, 0.3);
}

.auth-gate__button:disabled {
  cursor: not-allowed;
  opacity: 0.68;
  transform: none;
}

.auth-gate__message {
  min-height: 20px;
  margin: 4px 0 0;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.35;
  text-align: center;
}

.auth-gate__footer {
  position: absolute;
  left: 42px;
  right: 42px;
  bottom: 22px;
  color: rgba(242, 255, 246, 0.58);
  font-size: 12px;
  line-height: 1.35;
  text-align: center;
}

.auth-gate__loading {
  margin-top: 16px;
  color: var(--auth-muted);
  font-size: 13px;
  text-align: center;
}

@media (max-width: 520px) {
  .auth-gate {
    padding: 14px;
  }

  .auth-gate__card {
    min-height: 540px;
    padding: 34px 26px 28px;
  }

  .auth-gate__footer {
    left: 26px;
    right: 26px;
  }
}

/* Исправление поля пароля и автозаполнения браузера */
.auth-gate__input[type="password"],
.auth-gate__input[type="text"] {
  color: var(--auth-text);
  background: transparent !important;
  border: 0;
  outline: 0;
  box-shadow: none !important;
}

/* Убирает белую заливку Chrome/Yandex при автозаполнении */
.auth-gate__input:-webkit-autofill,
.auth-gate__input:-webkit-autofill:hover,
.auth-gate__input:-webkit-autofill:focus,
.auth-gate__input:-webkit-autofill:active {
  -webkit-text-fill-color: var(--auth-text) !important;
  caret-color: var(--auth-text);
  box-shadow: 0 0 0 1000px transparent inset !important;
  -webkit-box-shadow: 0 0 0 1000px transparent inset !important;
  transition: background-color 9999s ease-in-out 0s;
}

/* Делает скрытые символы пароля визуально аккуратными */
.auth-gate__input[type="password"] {
  letter-spacing: 0.12em;
}
