:root {
  --bg: #f0f3f2;
  --card: #ffffff;
  --text: #242727;
  --muted: #777e7e;
  --border: #c1d3d4;
  --accent: #0f9ca7;
  --accent-dark: #0c7d86;
  --button-off: #ececec;
  --button-off-text: #777e7e;
  --danger: #d4400a;
  --max: 1440px;
  --content: 800px;
  --sans:
    "Noto Sans JP", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Meiryo", sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-size: 16px;
}

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
}

a {
  color: var(--accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

.login-page {
  width: 100%;
}

.login-shell {
  width: min(100%, var(--content));
  margin: 0 auto;
  padding: 24px 0 100px;
}

.login-card {
  width: 100%;
  margin: 0 auto;
  padding: 48px 64px;
  background: var(--card);
  border-radius: 16px;
}

.login-title {
  margin: 0;
  text-align: center;
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.25;
}

.login-form {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  padding-top: 16px;
}

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

.field-label {
  font-size: 0.875rem;
  font-weight: 700;
  line-height: 1.5;
  color: var(--text);
}

.field-input {
  width: 100%;
  height: 44px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 4px;
  background: #fff;
  color: var(--text);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
  transition:
    border-color 0.2s ease,
    box-shadow 0.2s ease;
}

.field-input::placeholder {
  color: var(--muted);
}

.field-input:focus {
  outline: none;
  border-width: 2px;
  border-color: #0f9ca7;
  box-shadow: none;
}

.password-wrap {
  position: relative;
  display: block;
}

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

.password-toggle {
  position: absolute;
  top: 50%;
  right: 3px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 35px;
  margin: 0;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: pointer;
  transform: translateY(-50%);
}

.password-toggle__icon {
  width: 16px;
  height: 16px;
  background-image: url("../img/icon-password-hide.svg");
  background-position: center;
  background-repeat: no-repeat;
  background-size: 16px 16px;
}

.password-toggle.is-visible .password-toggle__icon {
  background-image: url("../img/icon-password-show.svg");
}

.remember-row {
  position: relative;
  display: flex;
  align-items: flex-start;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 10px 0;
  color: var(--text);
  cursor: pointer;
}

.remember-checkbox {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}

.remember-box {
  position: relative;
  flex: 0 0 20px;
  width: 20px;
  height: 20px;
  border: 1px solid #474e4e;
  border-radius: 2px;
  background: #fff;
}

.remember-box::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 6px;
  width: 4px;
  height: 8px;
  border-right: 1.8px solid #fff;
  border-bottom: 1.8px solid #fff;
  opacity: 0;
  transform: rotate(45deg);
}

.remember-text {
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.remember-checkbox:checked + .remember-box {
  border-color: var(--accent);
  background: var(--accent);
}

.remember-checkbox:checked + .remember-box::after {
  opacity: 1;
}

.remember-checkbox:focus-visible + .remember-box {
  outline: 3px solid rgba(15, 156, 167, 0.18);
  outline-offset: 2px;
}

.login-button {
  display: block;
  width: min(100%, 360px);
  height: 44px;
  margin: 0 auto;
}

.inline-link {
  display: block;
  margin-top: -8px;
  text-align: center;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.25;
  text-decoration: underline;
  text-decoration-skip-ink: none;
}

.login-note {
  margin: -8px 0 0;
  text-align: center;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.5;
}

.support-block {
  width: 100%;
  margin: 48px auto 0;
  color: var(--text);
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.5;
}

.support-block p {
  margin: 0;
}

.support-block p + p {
  margin-top: 24px;
}

.footer-links-card {
  width: 100%;
  min-height: 56px;
  margin: 48px auto 0;
  background: #fff;
  border-radius: 16px;
}

@media (max-width: 768px) {
  .site-header__context {
    text-align: right;
  }

  .login-shell {
    width: 100%;
    padding: 24px 0 48px;
  }

  .login-card {
    width: 100%;
    padding: 24px 32px;
    border-radius: 0;
  }

  .login-title {
    font-size: 1.5rem;
  }

  .login-form {
    gap: 20px;
  }

  .form-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .field-label {
    font-size: 0.875rem;
  }

  .field-input {
    height: 44px;
    font-size: 0.875rem;
    padding: 8px;
  }

  .remember-row {
    min-height: 42px;
    padding: 10px 0;
  }

  .remember-box {
    flex-basis: 20px;
    width: 20px;
    height: 20px;
  }

  .remember-box::after {
    top: 3px;
    left: 6px;
  }

  .remember-text,
  .inline-link,
  .footer-links-card a {
    font-size: 0.875rem;
  }

  .login-button {
    width: 100%;
    max-width: none;
    height: 44px;
  }

  .inline-link {
    margin-top: -4px;
  }

  .login-note {
    margin-top: -4px;
  }

  .support-block {
    width: 100%;
    margin-top: 32px;
    padding: 0 20px;
    font-size: 0.875rem;
  }

  .support-block p + p {
    margin-top: 24px;
  }

  .footer-links-card {
    width: 100%;
    margin-top: 32px;
    border-radius: 0;
  }
}
