:root {
  --color-white: #ffffff;
  --color-surface: rgba(255, 255, 255, 0.82);
  --color-surface-strong: rgba(255, 255, 255, 0.94);
  --color-border: rgba(134, 166, 206, 0.28);
  --color-border-strong: rgba(0, 117, 255, 0.42);
  --color-text: #102033;
  --color-muted: #61718a;
  --color-soft: #eef7ff;
  --brand-blue: #0077ff;
  --brand-blue-dark: #005ed8;
  --brand-blue-soft: #dff0ff;
  --error: #d92d20;
  --radius-card: 26px;
  --radius-input: 13px;
  --shadow-card: 0 28px 80px rgba(26, 67, 117, 0.18), 0 12px 32px rgba(15, 42, 75, 0.10);
  --shadow-focus: 0 0 0 4px rgba(0, 119, 255, 0.14);
  --transition: 180ms ease;
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  min-height: 100%;
}

body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
  overflow-x: hidden;
  font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--color-text);
  background: #f6fbff;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.login-page {
  position: relative;
  isolation: isolate;
  display: flex;
  min-height: 100vh;
  min-height: 100svh;
  overflow: hidden;
  padding: clamp(24px, 4vw, 56px);
}

.login-bg,
.login-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.login-bg {
  z-index: -3;
  object-fit: cover;
  object-position: 68% center;
  filter: blur(7px) saturate(0.82);
  transform: scale(1.035);
  opacity: 0.48;
}

.login-overlay {
  z-index: -2;
  background:
    linear-gradient(110deg, rgba(255, 255, 255, 0.92) 0%, rgba(247, 252, 255, 0.84) 37%, rgba(228, 243, 255, 0.58) 64%, rgba(225, 241, 255, 0.72) 100%),
    radial-gradient(circle at 18% 18%, rgba(255, 255, 255, 0.88), transparent 34%),
    radial-gradient(circle at 88% 84%, rgba(0, 119, 255, 0.17), transparent 32%);
}

.login-overlay::after {
  content: "";
  position: absolute;
  inset: auto -10% -18% -10%;
  height: 42%;
  background: linear-gradient(0deg, rgba(255, 255, 255, 0.88), rgba(255, 255, 255, 0));
}

.login-shell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding-left: clamp(0px, 7vw, 96px);
}

.login-card {
  width: min(100%, 460px);
  padding: clamp(30px, 4vw, 46px);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-card);
  background: linear-gradient(145deg, var(--color-surface-strong), var(--color-surface));
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  animation: cardEnter 620ms cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.brand {
  display: flex;
  justify-content: center;
  margin-bottom: 22px;
}

.brand-logo {
  display: block;
  width: min(230px, 62vw);
  height: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 1px 0 rgba(16, 32, 51, 0.58))
    drop-shadow(1px 0 0 rgba(16, 32, 51, 0.46))
    drop-shadow(-1px 0 0 rgba(16, 32, 51, 0.36))
    drop-shadow(0 14px 24px rgba(0, 119, 255, 0.14));
}

.login-header {
  margin-bottom: 28px;
  text-align: center;
}

.login-header h1 {
  margin: 0;
  font-size: clamp(26px, 3.3vw, 34px);
  line-height: 1.08;
  font-weight: 800;
  letter-spacing: 0;
  color: #12213a;
}

.login-header p {
  margin: 10px 0 0;
  color: var(--color-muted);
  font-size: 15px;
  line-height: 1.55;
}

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

.form-message {
  display: none;
  border: 1px solid rgba(217, 45, 32, 0.18);
  border-radius: 12px;
  background: rgba(217, 45, 32, 0.08);
  color: var(--error);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  padding: 10px 12px;
}

.form-message.is-visible {
  display: flex;
  align-items: center;
  gap: 8px;
}

.form-message.is-error {
  border-color: rgba(217, 45, 32, 0.18);
  background: rgba(217, 45, 32, 0.08);
  color: var(--error);
}

.form-message.is-success {
  border-color: rgba(15, 163, 98, 0.18);
  background: rgba(15, 163, 98, 0.08);
  color: #0f8a54;
}

.login-card > .form-message {
  margin-bottom: 15px;
}

.field-group {
  display: grid;
  gap: 8px;
}

.field-group label {
  font-size: 13px;
  font-weight: 700;
  color: #31435d;
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 56px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-input);
  background: rgba(255, 255, 255, 0.72);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 10px 24px rgba(30, 70, 110, 0.06);
  transition: border-color var(--transition), box-shadow var(--transition), background var(--transition), transform var(--transition);
}

.input-wrap:focus-within {
  border-color: var(--color-border-strong);
  background: var(--color-white);
  box-shadow: var(--shadow-focus), 0 14px 30px rgba(0, 119, 255, 0.10);
  transform: translateY(-1px);
}

.input-icon {
  flex: 0 0 auto;
  width: 48px;
  text-align: center;
  color: #8ba0bd;
  font-size: 15px;
  transition: color var(--transition);
}

.input-wrap:focus-within .input-icon {
  color: var(--brand-blue);
}

.input-wrap input:not([type="checkbox"]) {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font-size: 15px;
  font-weight: 600;
  padding: 16px 16px 16px 0;
}

.input-wrap input::placeholder {
  color: #91a1b9;
  font-weight: 500;
}

.password-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  margin-right: 6px;
  border: 0;
  border-radius: 12px;
  color: #8296b4;
  background: transparent;
  transition: color var(--transition), background var(--transition);
}

.password-toggle:hover,
.password-toggle:focus-visible {
  color: var(--brand-blue);
  background: var(--brand-blue-soft);
  outline: 0;
}

.form-options {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 28px;
  margin-top: 1px;
}

.remember-control {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #4c607b;
  font-size: 14px;
  font-weight: 600;
  user-select: none;
  cursor: pointer;
}

.remember-control input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
}

.checkbox-ui {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  border: 1px solid rgba(113, 135, 168, 0.48);
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.82);
  color: var(--color-white);
  font-size: 10px;
  box-shadow: 0 8px 16px rgba(42, 84, 129, 0.08);
  transition: background var(--transition), border-color var(--transition), box-shadow var(--transition), transform var(--transition);
}

.checkbox-ui i {
  opacity: 0;
  transform: scale(0.72);
  transition: opacity var(--transition), transform var(--transition);
}

.remember-control input:checked + .checkbox-ui {
  border-color: var(--brand-blue);
  background: linear-gradient(135deg, var(--brand-blue), var(--brand-blue-dark));
  box-shadow: 0 8px 18px rgba(0, 119, 255, 0.28);
}

.remember-control input:checked + .checkbox-ui i {
  opacity: 1;
  transform: scale(1);
}

.remember-control input:focus-visible + .checkbox-ui {
  box-shadow: var(--shadow-focus);
}

.login-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 56px;
  margin-top: 9px;
  border: 0;
  border-radius: 13px;
  color: var(--color-white);
  background: linear-gradient(135deg, #1096ff 0%, var(--brand-blue) 45%, #005bd7 100%);
  box-shadow: 0 18px 34px rgba(0, 105, 235, 0.31);
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
  transition: transform var(--transition), box-shadow var(--transition), filter var(--transition);
}

.login-button:hover,
.login-button:focus-visible {
  transform: translateY(-2px);
  filter: saturate(1.05);
  box-shadow: 0 22px 42px rgba(0, 105, 235, 0.38);
  outline: 0;
}

.login-button:active {
  transform: translateY(0);
}

.secure-note {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin: 27px 0 0;
  color: #75859d;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.45;
  text-align: center;
}

.secure-note::before,
.secure-note::after {
  content: "";
  flex: 1 1 32px;
  max-width: 76px;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(117, 133, 157, 0.24));
}

.secure-note::after {
  background: linear-gradient(90deg, rgba(117, 133, 157, 0.24), transparent);
}

.secure-note i {
  color: #8ca0ba;
}

@keyframes cardEnter {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 1ms !important;
    scroll-behavior: auto !important;
    transition-duration: 1ms !important;
  }
}

@media (min-width: 1025px) {
  .login-shell {
    justify-content: flex-start;
  }

  .login-card {
    margin-left: clamp(24px, 5vw, 90px);
  }
}

@media (min-width: 769px) and (max-width: 1024px) {
  .login-page {
    padding: 40px;
  }

  .login-shell {
    padding-left: 0;
  }

  .login-card {
    width: min(100%, 450px);
  }
}

@media (min-width: 481px) and (max-width: 768px) {
  .login-page {
    align-items: center;
    padding: 32px;
  }

  .login-bg {
    object-position: 62% center;
    opacity: 0.42;
  }

  .login-shell {
    padding-left: 0;
  }

  .login-card {
    width: min(100%, 440px);
    padding: 34px;
  }
}

@media (max-width: 480px) {
  body {
    background: #f7fbff;
  }

  .login-page {
    align-items: center;
    min-height: 100vh;
    min-height: 100svh;
    padding: max(18px, env(safe-area-inset-top)) 0 max(18px, env(safe-area-inset-bottom));
    overflow-y: auto;
  }

  .login-bg {
    object-position: 74% center;
    filter: blur(2.5px) saturate(1.02) contrast(1.04);
    opacity: 0.82;
  }

  .login-overlay {
    background:
      linear-gradient(180deg, rgba(255, 255, 255, 0.58), rgba(231, 244, 255, 0.42)),
      radial-gradient(circle at 50% 0%, rgba(0, 119, 255, 0.11), transparent 38%);
  }

  .login-shell {
    width: 100%;
    min-height: 100%;
    padding: 0;
  }

  .login-card {
    width: min(100% - 32px, 420px);
    padding: 26px 20px 24px;
    border-radius: 22px;
    background: linear-gradient(145deg, rgba(255, 255, 255, 0.86), rgba(248, 252, 255, 0.7));
  }

  .brand {
    margin-bottom: 18px;
  }

  .brand-logo {
    width: min(188px, 56vw);
  }

  .login-header {
    margin-bottom: 23px;
  }

  .login-header h1 {
    font-size: 25px;
  }

  .login-header p {
    font-size: 14px;
  }

  .login-form {
    gap: 13px;
  }

  .field-group label {
    font-size: 12px;
  }

  .input-wrap {
    min-height: 52px;
  }

  .input-icon {
    width: 43px;
  }

  .input-wrap input:not([type="checkbox"]) {
    font-size: 14px;
    padding-top: 15px;
    padding-bottom: 15px;
  }

  .password-toggle {
    flex-basis: 40px;
    width: 40px;
    height: 40px;
    margin-right: 5px;
  }

  .remember-control,
  .secure-note {
    font-size: 12px;
  }

  .login-button {
    min-height: 52px;
    font-size: 14px;
  }

  .secure-note {
    margin-top: 22px;
  }
}

@media (max-width: 360px) {
  .login-card {
    width: min(100% - 24px, 420px);
    padding: 22px 16px 20px;
  }

  .brand-logo {
    width: 164px;
  }

  .login-header h1 {
    font-size: 23px;
  }

  .login-header p {
    font-size: 13px;
  }

  .secure-note::before,
  .secure-note::after {
    display: none;
  }
}
