:root {
  --primary: rgb(23, 66, 140);
  --primary-hover: rgb(18, 52, 112);
  --secondary: #f7f6f3;
  --card-bg: rgba(247, 246, 243, 0.97);
  --input-bg: #efeee9;
  --border: #d8dee8;
  --text: #1a2233;
  --muted: #6b7385;
  --danger: #dc2626;
  --radius: 14px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --display: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: var(--font);
  color: var(--text);
  background: #0a0c10;
}

.login-page {
  height: 100vh;
  height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  padding: 1.25rem 3.5vw;
  overflow: hidden;
  background:
    url("../images/login-bgfull.png") center center / cover no-repeat;
  background-color: #0a0c10;
}

.login-panel {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  max-width: 400px;
  padding: 0;
  background: transparent;
}

.login-card {
  width: 100%;
  max-width: 380px;
  max-height: calc(100vh - 2.5rem);
  max-height: calc(100dvh - 2.5rem);
  overflow: hidden;
  background: var(--card-bg);
  border: 1px solid rgba(255, 255, 255, 0.65);
  border-radius: 14px;
  padding: 1.55rem 1.6rem 1.3rem;
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.28);
  backdrop-filter: blur(12px);
  animation: cardIn 0.55s ease both;
  color: var(--text);
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.brand {
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.95rem;
}

.brand-logo {
  display: block;
  width: auto;
  max-width: 160px;
  max-height: 46px;
  height: auto;
  object-fit: contain;
}

h1 {
  margin: 0 0 0.25rem;
  text-align: center;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--text);
}

.subtitle {
  margin: 0 0 1.05rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.86rem;
}

.alert {
  margin-bottom: 0.8rem;
  padding: 0.6rem 0.8rem;
  border-radius: 8px;
  background: rgba(220, 38, 38, 0.08);
  border: 1px solid rgba(220, 38, 38, 0.28);
  color: var(--danger);
  font-size: 0.8rem;
}

.field {
  margin-bottom: 0.85rem;
}

.field label {
  display: block;
  margin-bottom: 0.35rem;
  font-size: 0.82rem;
  font-weight: 500;
  color: #2a3344;
}

.field input {
  width: 100%;
  height: 42px;
  padding: 0 0.85rem;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.field input::placeholder {
  color: #9aa3b5;
}

.field input:focus {
  border-color: var(--primary);
  background: var(--secondary);
  box-shadow: 0 0 0 3px rgba(23, 66, 140, 0.18);
}

.password-wrap {
  position: relative;
  display: flex;
  align-items: center;
  height: 42px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--input-bg);
  overflow: hidden;
}

.password-wrap:focus-within {
  border-color: var(--primary);
  background: var(--secondary);
  box-shadow: 0 0 0 3px rgba(23, 66, 140, 0.18);
}

.password-wrap input {
  flex: 1;
  min-width: 0;
  height: 100% !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  padding: 0 2.6rem 0 2.45rem !important;
  border-radius: 0;
}

.input-icon {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  color: #8a93a5;
  display: grid;
  place-items: center;
  pointer-events: none;
  z-index: 1;
}

.input-icon-left {
  left: 0.75rem;
}

.input-icon svg {
  width: 16px;
  height: 16px;
  display: block;
}

.toggle-password {
  position: absolute;
  right: 0.35rem;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border: 0;
  background: transparent;
  color: #8a93a5;
  cursor: pointer;
  padding: 0;
  display: grid;
  place-items: center;
  z-index: 1;
}

.toggle-password svg {
  width: 18px;
  height: 18px;
  display: block;
  pointer-events: none;
}

.toggle-password .icon-eye-off {
  display: none;
}

.toggle-password.is-visible .icon-eye {
  display: none;
}

.toggle-password.is-visible .icon-eye-off {
  display: block;
}

.toggle-password:hover {
  color: var(--primary);
}

.btn-primary {
  width: 100%;
  height: 42px;
  margin-top: 0.2rem;
  border: 0;
  border-radius: 8px;
  background: var(--primary);
  color: var(--secondary);
  font-family: var(--display);
  font-size: 0.94rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.15s ease;
}

.btn-primary:hover {
  background: var(--primary-hover);
}

.btn-primary:active {
  transform: scale(0.985);
}

.divider {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin: 0.9rem 0 0.75rem;
  color: #8a93a5;
  font-size: 0.78rem;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: #e2e7ef;
}

.btn-outline {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 40px;
  border-radius: 8px;
  border: 1px solid #c9d1de;
  background: var(--secondary);
  color: var(--primary);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 600;
  font-size: 0.9rem;
  transition: border-color 0.2s ease, background 0.2s ease;
}

.btn-outline:hover {
  border-color: var(--primary);
  background: rgba(23, 66, 140, 0.05);
}

.footer-note {
  margin: 1rem 0 0;
  text-align: center;
  font-size: 0.66rem;
  line-height: 1.45;
  color: #8a93a5;
}

.footer-note strong {
  color: #4a5568;
  font-weight: 600;
}

@media (max-width: 900px) {
  html,
  body {
    overflow: auto;
  }

  .login-page {
    justify-content: center;
    padding: 1rem 1rem;
    overflow: auto;
    min-height: 100vh;
    height: auto;
  }

  .login-panel {
    max-width: 400px;
  }

  .login-card {
    max-width: 400px;
    max-height: none;
    margin: 0 auto;
  }
}

@media (max-height: 720px) {
  .login-card {
    padding: 1.2rem 1.3rem 1.05rem;
  }

  .brand {
    margin-bottom: 0.7rem;
  }

  .brand-logo {
    max-width: 140px;
    max-height: 40px;
  }

  h1 {
    font-size: 1.3rem;
  }

  .subtitle {
    margin-bottom: 0.8rem;
    font-size: 0.8rem;
  }

  .field {
    margin-bottom: 0.65rem;
  }

  .field input,
  .btn-primary {
    height: 38px;
  }

  .btn-outline {
    height: 36px;
  }

  .divider {
    margin: 0.7rem 0 0.6rem;
  }

  .footer-note {
    margin-top: 0.75rem;
  }
}
