/* Окно авторизации: фоновое изображение + чистая белая плашка (ПК справа, телефон снизу) */
:root {
  --ink: #161426;
  --ink-hover: #272342;
  --text: #161426;
  --muted: #6e6c7c;
  --line: #e4e3ec;
  --line-focus: #4f46e5;
  --field: #f7f7fb;
  --bad: #c4382f;
  --font: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }

body {
  font-family: var(--font);
  color: var(--text);
  background: #0a0b24 url("../assets/auth-desktop.png") center / cover no-repeat fixed;
  min-height: 100dvh;
  display: flex;
  justify-content: flex-end;
  align-items: stretch;
  -webkit-font-smoothing: antialiased;
  overflow: hidden;
}

@keyframes panelInDesktop {
  from { opacity: 0; transform: translateX(28px); }
  to { opacity: 1; transform: none; }
}
@keyframes panelInMobile {
  from { opacity: 0; transform: translateY(28px); }
  to { opacity: 1; transform: none; }
}

.auth-panel {
  width: min(420px, 42vw);
  min-width: 340px;
  background: #ffffff;
  border-radius: 28px 0 0 28px;
  padding: 48px 44px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  box-shadow: -16px 0 48px rgba(4, 5, 22, 0.36);
  animation: panelInDesktop 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.auth-form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.auth-title {
  margin: 0 0 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--text);
}

.field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field label {
  font-size: 13px;
  font-weight: 500;
  color: var(--muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.field input {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border-radius: 12px;
  border: 1.5px solid var(--line);
  background: var(--field);
  color: var(--text);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.16s, background 0.16s, box-shadow 0.16s;
}

.field input.has-eye {
  padding-right: 44px;
}

.field input:focus {
  border-color: var(--line-focus);
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.12);
}

.eye {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 9px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: color 0.15s, background 0.15s;
}

.eye:hover {
  color: var(--text);
  background: rgba(22, 20, 38, 0.06);
}

.eye svg {
  width: 18px;
  height: 18px;
}

.auth-err {
  min-height: 20px;
  font-size: 13px;
  color: var(--bad);
  line-height: 1.4;
}

.auth-err:empty {
  display: none;
}

.auth-btn {
  margin-top: 4px;
  height: 48px;
  border: 0;
  border-radius: 12px;
  background: var(--ink);
  color: #ffffff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.16s, transform 0.12s, opacity 0.16s;
}

.auth-btn:hover:not(:disabled) {
  background: var(--ink-hover);
}

.auth-btn:active:not(:disabled) {
  transform: scale(0.99);
}

.auth-btn:disabled {
  opacity: 0.55;
  cursor: default;
}

/* Версия для телефона: вертикальный фон + белая плашка снизу экрана */
@media (max-width: 768px) {
  body {
    background-image: url("../assets/auth-mobile.png");
    background-attachment: scroll;
    flex-direction: column;
    justify-content: flex-end;
    align-items: stretch;
    overflow-y: auto;
  }

  .auth-panel {
    width: 100%;
    min-width: 0;
    border-radius: 28px 28px 0 0;
    padding: 32px 24px calc(28px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -14px 40px rgba(4, 5, 22, 0.42);
    animation: panelInMobile 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
  }

  .auth-title {
    font-size: 24px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .auth-panel { animation: none; }
}
