:root {
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  font-size: 14px;
  color: #252a30;
  background: #f5f6f7;
  font-synthesis: none;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
}

button,
input {
  font: inherit;
}

button,
a,
input {
  touch-action: manipulation;
}

a {
  color: #245b91;
  text-underline-offset: 3px;
}

button {
  cursor: pointer;
}

button:focus-visible,
a:focus-visible,
input:focus-visible {
  outline: 2px solid #245b91;
  outline-offset: 3px;
}

h1 {
  margin: 0 0 24px;
  font-size: 21px;
  font-weight: 600;
  line-height: 1.5;
}

p {
  margin: 0 0 16px;
  line-height: 1.7;
}

.skip-link {
  position: absolute;
  top: -100px;
  left: 16px;
  z-index: 1;
  padding: 10px;
  background: #fff;
}

.skip-link:focus {
  top: 10px;
}

.app-name {
  margin: 0;
  color: #252a30;
  font-size: 17px;
  font-weight: 600;
  text-decoration: none;
  white-space: nowrap;
}

.app-header {
  display: flex;
  align-items: center;
  gap: 36px;
  min-height: 64px;
  padding: 0 32px;
  border-bottom: 1px solid #dfe2e5;
  background: #fff;
}

.main-nav {
  display: flex;
  align-self: stretch;
  gap: 24px;
}

.main-nav a {
  display: flex;
  align-items: center;
  border-bottom: 2px solid transparent;
  color: #555f6b;
  text-decoration: none;
}

.main-nav a.active {
  border-bottom-color: #555f6b;
  color: #252a30;
}

.logout-form {
  margin-left: auto;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 8px 18px;
  border: 1px solid #c5cbd1;
  border-radius: 3px;
  background: #fff;
  color: #353d46;
  font-weight: 500;
  line-height: 1.4;
  text-decoration: none;
}

.button:hover {
  background: #f0f2f4;
}

.button-primary {
  border-color: #245b91;
  background: #245b91;
  color: #fff;
}

.button-primary:hover {
  border-color: #1c4873;
  background: #1c4873;
}

.page-container {
  width: calc(100% - 48px);
  max-width: 960px;
  margin: 36px auto;
}

.login-page {
  width: calc(100% - 32px);
  max-width: 400px;
  margin: 72px auto 32px;
}

.login-page .app-name {
  margin-bottom: 20px;
}

.form-panel {
  padding: 24px;
  border: 1px solid #dfe2e5;
  border-radius: 4px;
  background: #fff;
}

.stack-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field label {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px;
}

.field input {
  width: 100%;
  min-width: 0;
  height: 44px;
  padding: 8px 10px;
  border: 1px solid #bbc2ca;
  border-radius: 3px;
  background: #fff;
  color: #252a30;
  font-size: 16px;
}

.password-input {
  position: relative;
}

.password-input input {
  padding-right: 66px;
}

.password-toggle {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 32px;
  padding: 0 8px;
  border: 0;
  border-radius: 2px;
  background: transparent;
  color: #555f6b;
  font-size: 12px;
}

.password-toggle:hover {
  background: #f0f2f4;
}

.login-submit {
  width: 100%;
}

.help-text {
  margin: 0;
  color: #606b77;
  font-size: 12px;
  line-height: 1.7;
}

.login-page > .help-text {
  margin-top: 16px;
}

.account-page {
  max-width: 640px;
}

.optional-label {
  color: #606b77;
  font-size: 12px;
}

hr {
  width: 100%;
  margin: 0;
  border: 0;
  border-top: 1px solid #e4e7ea;
}

.form-actions {
  padding-top: 4px;
}

.notice {
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid;
  border-radius: 3px;
  line-height: 1.7;
}

.notice-error {
  border-color: #e7c6c6;
  background: #fff6f6;
  color: #8b2f2f;
}

.notice-info {
  border-color: #cbd8e5;
  background: #f3f7fb;
  color: #345575;
}

.notice-success {
  border-color: #c9dfce;
  background: #f3f9f4;
  color: #365f3e;
}

.account-summary {
  display: grid;
  grid-template-columns: 140px minmax(0, 1fr);
  max-width: 640px;
  margin: 24px 0;
  padding: 16px 0;
  border-top: 1px solid #dfe2e5;
  border-bottom: 1px solid #dfe2e5;
}

.account-summary dt {
  color: #606b77;
}

.account-summary dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.error-page {
  max-width: 640px;
  margin-top: 72px;
}

@media (max-width: 640px) {
  .app-header {
    flex-wrap: wrap;
    gap: 16px;
    padding: 16px 20px 0;
  }

  .main-nav {
    order: 1;
    width: 100%;
    gap: 24px;
    min-height: 40px;
  }

  .logout-form .button {
    padding-right: 12px;
    padding-left: 12px;
    font-size: 12px;
  }

  .page-container {
    width: calc(100% - 32px);
    margin-top: 28px;
  }

  .login-page {
    margin-top: 40px;
  }

  .form-panel {
    padding: 20px;
  }

  .form-actions .button,
  .login-submit {
    min-height: 44px;
  }

  .account-summary {
    grid-template-columns: 1fr;
    gap: 8px;
  }
}
