:root {
  --pink: #fbd3f0;
  --aqua: #c4f7ff;
  --lav: #d9c7ff;
  --blue: #d3e8ff;

  --bg1: #ecf8ff;
  --bg2: #d8f0ff;
  --bg3: #cde7f7;
  --bg4: #bbe2fa;

  --ink: #07041b;
  --muted: rgba(7, 4, 27, 0.62);
  --glass: rgba(255, 255, 255, 0.34);
  --glass-strong: rgba(255, 255, 255, 0.5);
  --glass-border: rgba(7, 4, 27, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
  font-family: "Quicksand", system-ui, sans-serif;
  color: var(--ink);
  background: radial-gradient(
    circle at 50% 30%,
    var(--bg1) 0%,
    var(--bg2) 35%,
    var(--bg3) 65%,
    var(--bg4) 100%
  );
  scrollbar-width: none;
  -ms-overflow-style: none;
}

html::-webkit-scrollbar,
body::-webkit-scrollbar {
  display: none;
}

body {
  min-height: 100vh;
  min-height: 100svh;
  overflow-x: hidden;
  overflow-y: auto;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 18% 22%, rgba(251, 211, 240, 0.5), transparent 32%),
    radial-gradient(circle at 82% 18%, rgba(196, 247, 255, 0.62), transparent 34%),
    radial-gradient(circle at 52% 86%, rgba(217, 199, 255, 0.34), transparent 34%);
  z-index: 0;
}

.login-header {
  position: relative;
  z-index: 20;
  width: min(1240px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: clamp(10px, 1.8vw, 24px);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  opacity: 0;
  animation: fadeInSoft 0.75s ease forwards 0.2s;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--ink);
  white-space: nowrap;
}

.brand img {
  width: 32px;
  height: 32px;
  display: block;
}

.brand span {
  font-size: 17px;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.back-home-link {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  color: var(--ink);
  text-decoration: none;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.back-home-link::after,
.forgot-link::after,
.switch-link a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -7px;
  width: 100%;
  height: 1.5px;
  border-radius: 999px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: center;
  opacity: 0;
  transition:
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    opacity 0.3s ease;
}

.back-home-link:hover::after,
.forgot-link:hover::after,
.switch-link a:hover::after {
  transform: scaleX(1);
  opacity: 1;
}

.login-page {
  position: relative;
  z-index: 1;
  min-height: calc(100vh - 56px);
  min-height: calc(100svh - 56px);
  width: min(520px, calc(100% - 48px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: clamp(36px, 8svh, 76px) 0 clamp(20px, 4svh, 40px);
}

.login-panel {
  width: 100%;
  position: relative;
  opacity: 0;
  transform: translateY(16px);
  animation: panelIn 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards 0.35s;
}

.form-card {
  width: 100%;
  padding: clamp(22px, 2.5vw, 32px);
  border-radius: 34px;
  border: 1px solid rgba(7, 4, 27, 0.12);
  background: rgba(255, 255, 255, 0.42);
  box-shadow: 0 24px 74px rgba(7, 4, 27, 0.12);
  backdrop-filter: blur(22px);
}

.form-heading {
  margin-bottom: 24px;
}

.form-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 7px 11px;
  border-radius: 999px;
  border: 1px solid rgba(7, 4, 27, 0.12);
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(14px);
  color: rgba(7, 4, 27, 0.66);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.form-kicker::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--pink), var(--aqua));
  box-shadow: 0 0 12px rgba(196, 247, 255, 0.9);
}

.form-heading h1 {
  margin: 0;
  font-size: clamp(32px, 3.1vw, 46px);
  line-height: 0.98;
  letter-spacing: -0.06em;
  font-weight: 700;
}

.form-heading p {
  margin: 16px 0 0;
  color: rgba(7, 4, 27, 0.64);
  font-size: 14px;
  line-height: 1.55;
  font-weight: 500;
}

.login-form {
  display: grid;
  gap: 12px;
}

.form-field {
  position: relative;
  display: grid;
  gap: 8px;
}

.form-field span,
.remember-field span {
  color: rgba(7, 4, 27, 0.66);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.form-field input {
  width: 100%;
  height: 48px;
  border: 1px solid rgba(7, 4, 27, 0.13);
  border-radius: 18px;
  padding: 0 15px;
  background: rgba(255, 255, 255, 0.42);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  outline: none;
  transition:
    border-color 0.3s ease,
    box-shadow 0.3s ease,
    background 0.3s ease;
}

.form-field input::placeholder {
  color: rgba(7, 4, 27, 0.36);
}

.form-field input:focus {
  border-color: rgba(7, 4, 27, 0.32);
  background: rgba(255, 255, 255, 0.58);
  box-shadow: 0 0 0 4px rgba(196, 247, 255, 0.36);
}

.password-field input {
  padding-right: 72px;
}

.password-toggle {
  position: absolute;
  right: 8px;
  top: 31px;
  height: 36px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(7, 4, 27, 0.08);
  color: rgba(7, 4, 27, 0.7);
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.3s ease, transform 0.3s ease;
}

.password-toggle:hover {
  transform: translateY(-1px);
  background: rgba(7, 4, 27, 0.12);
}

.field-error {
  min-height: 16px;
  color: #8a2338;
  font-size: 11px;
  line-height: 1.35;
  font-weight: 700;
  opacity: 0;
  transform: translateY(-2px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.field-error:not(:empty) {
  opacity: 1;
  transform: translateY(0);
}

.form-field.has-error input {
  border-color: rgba(138, 35, 56, 0.44);
  box-shadow: 0 0 0 4px rgba(138, 35, 56, 0.08);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 2px;
  flex-wrap: nowrap;
}

.remember-field {
  display: inline-flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
}

.remember-field input {
  width: 17px;
  height: 17px;
  margin: 1px 0 0;
  accent-color: var(--ink);
  flex: 0 0 auto;
}

.forgot-link {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 12px;
  font-weight: 700;
  white-space: nowrap;
}

.forgot-link::after,
.switch-link a::after {
  bottom: -5px;
}

.form-message {
  min-height: 18px;
  margin: 0;
  color: rgba(7, 4, 27, 0.72);
  font-size: 12px;
  line-height: 1.4;
  font-weight: 700;
}

.form-message.is-error {
  color: #8a2338;
}

.form-message.is-success {
  color: #145948;
}

.submit-btn {
  width: 100%;
  min-height: 52px;
  margin-top: 2px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  background: var(--ink);
  color: var(--bg1);
  box-shadow: 0 18px 38px rgba(7, 4, 27, 0.2);
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition:
    transform 0.45s cubic-bezier(0.16, 1, 0.3, 1),
    box-shadow 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

.submit-btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 24px 52px rgba(7, 4, 27, 0.26);
}

.switch-link {
  margin: 18px 0 0;
  text-align: center;
  color: rgba(7, 4, 27, 0.62);
  font-size: 13px;
  font-weight: 600;
}

.switch-link a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-weight: 700;
}

@keyframes fadeInSoft {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

@media (max-width: 700px) {
  .login-header {
    width: min(100%, calc(100% - 32px));
    gap: 14px;
  }

  .back-home-link {
    font-size: 13px;
  }

  .login-page {
    width: min(100%, calc(100% - 28px));
    min-height: calc(100svh - 54px);
    padding-top: 34px;
    padding-bottom: 18px;
  }

  .form-row {
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .brand img {
    width: 30px;
    height: 30px;
  }

  .brand span {
    font-size: 15px;
  }

  .back-home-link {
    font-size: 12px;
  }

  .form-card {
    border-radius: 28px;
    padding: 20px;
  }

  .form-heading h1 {
    font-size: 32px;
  }

  .form-heading p {
    font-size: 13px;
  }

  .form-field input {
    height: 48px;
    border-radius: 16px;
  }

  .form-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: nowrap;
  }

  .remember-field span,
  .forgot-link {
    font-size: 11px;
  }
}

.auth-legal {
  position: fixed;
  left: 50%;
  bottom: 18px;
  transform: translateX(-50%);
  z-index: 5;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  width: calc(100% - 32px);
  color: rgba(7, 4, 27, 0.5);
  font-size: 12px;
  text-align: center;
}

.auth-legal a {
  color: inherit;
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: color 0.25s ease, border-color 0.25s ease;
}

.auth-legal a:hover,
.auth-legal a:focus-visible {
  color: #07041b;
  border-color: currentColor;
}

.checkbox-field a {
  color: inherit;
  font-weight: 700;
  text-underline-offset: 3px;
}

@media (max-width: 560px) {
  .auth-legal {
    position: static;
    transform: none;
    margin: 24px auto 16px;
    flex-wrap: wrap;
  }
}

