:root {
  --bg: #f5f7fb;
  --ink: #17202f;
  --muted: #667085;
  --line: #d7dce5;
  --card: rgba(255, 255, 255, 0.92);
  --primary: #0f2747;
  --primary-hover: #17385f;
  --accent: #f37735;
  --ok: #16a36a;
  --warn: #f6b342;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, Pretendard, "Noto Sans KR", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

a {
  color: inherit;
}

.login-page {
  position: relative;
  display: grid;
  min-height: 100vh;
  place-items: center;
  overflow: hidden;
  padding: 32px 20px;
}

.scene {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background:
    linear-gradient(90deg, rgba(245, 247, 251, 0.9) 0%, rgba(245, 247, 251, 0.72) 42%, rgba(245, 247, 251, 0.18) 100%),
    linear-gradient(180deg, rgba(15, 39, 71, 0.08), rgba(15, 39, 71, 0.2)),
    url("/assets/vending-login-background.png") center / cover no-repeat;
}

.scene::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 18%, rgba(255, 255, 255, 0.72), transparent 28%),
    linear-gradient(90deg, rgba(255, 255, 255, 0.46), transparent 64%);
  backdrop-filter: blur(1px);
}

.login-card {
  position: relative;
  z-index: 1;
  width: min(100%, 420px);
  padding: 34px;
  border: 1px solid rgba(215, 220, 229, 0.92);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 24px 90px rgba(15, 39, 71, 0.18);
  backdrop-filter: blur(18px);
}

.brand-mark {
  display: grid;
  width: 52px;
  height: 52px;
  margin: 0 auto 16px;
  place-items: center;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), #214d78);
  color: #fff;
  box-shadow: 0 10px 24px rgba(15, 39, 71, 0.22);
}

.brand-mark span {
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 0;
}

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

.eyebrow {
  margin: 0 0 8px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

.login-heading h1 {
  margin: 0;
  color: var(--primary);
  font-size: 30px;
  line-height: 1.2;
  letter-spacing: 0;
}

.login-heading p:last-child {
  margin: 9px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.field {
  display: grid;
  gap: 7px;
}

.field span {
  color: #454f5f;
  font-size: 13px;
  font-weight: 700;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  font-size: 14px;
  outline: none;
  transition: border-color 150ms ease, box-shadow 150ms ease, background 150ms ease;
}

.password-field {
  position: relative;
}

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

.password-toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  height: 30px;
  min-width: 42px;
  padding: 0 9px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: #576273;
  cursor: pointer;
  font-size: 12px;
  font-weight: 800;
  transform: translateY(-50%);
}

.password-toggle:hover {
  background: rgba(33, 112, 228, 0.08);
  color: #1d5ec8;
}

.password-toggle:focus-visible {
  outline: 2px solid rgba(33, 112, 228, 0.42);
  outline-offset: 1px;
}

.field input:focus {
  border-color: #2170e4;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(33, 112, 228, 0.14);
}

.form-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 24px;
  color: var(--muted);
  font-size: 13px;
}

.remember {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  white-space: nowrap;
}

.remember input {
  width: 16px;
  height: 16px;
  accent-color: var(--primary);
}

.form-row a {
  color: #1d5ec8;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}

.login-button {
  height: 46px;
  border: 0;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 15px;
  font-weight: 800;
  transition: background 150ms ease, transform 150ms ease;
}

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

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

.form-message {
  min-height: 18px;
  margin: -4px 0 0;
  color: var(--ok);
  font-size: 13px;
  text-align: center;
}

.login-footer {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 8px 12px;
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid rgba(215, 220, 229, 0.78);
  color: #7b8494;
  font-size: 12px;
}

.login-footer a {
  color: #576273;
  font-weight: 700;
  text-decoration: none;
}

.password-setup-modal {
  position: fixed;
  inset: 0;
  z-index: 10;
  display: grid;
  place-items: center;
  padding: 24px;
  background: rgba(23, 32, 47, 0.38);
}

.password-setup-modal.hidden {
  display: none;
}

.password-setup-card {
  display: grid;
  width: min(100%, 420px);
  gap: 18px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 24px 80px rgba(15, 39, 71, 0.2);
}

.password-setup-header h2 {
  margin: 0;
  color: var(--primary);
  font-size: 22px;
  line-height: 1.3;
}

.password-setup-header p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.password-setup-message {
  min-height: 18px;
  margin: -4px 0 0;
  font-size: 13px;
  font-weight: 700;
  line-height: 18px;
}

.password-setup-actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding-top: 4px;
}

.password-setup-actions button {
  height: 42px;
  min-width: 88px;
  border-radius: 6px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 800;
}

.password-setup-cancel {
  border: 1px solid var(--line);
  background: #fff;
  color: var(--muted);
}

.password-setup-submit {
  border: 0;
  background: var(--primary);
  color: #fff;
}

@media (max-width: 760px) {
  .login-page {
    align-items: end;
    padding: 24px 16px;
  }

  .login-card {
    padding: 28px 22px;
  }

  .scene {
    background:
      linear-gradient(180deg, rgba(245, 247, 251, 0.35) 0%, rgba(245, 247, 251, 0.72) 42%, rgba(245, 247, 251, 0.94) 100%),
      url("/assets/vending-login-background.png") 58% 0% / cover no-repeat;
  }
}
