:root {
  --ima-auth-brand: #c92036;
  --ima-auth-brand-deep: #8f1424;
  --ima-auth-gold: #c7a45b;
  --ima-auth-ink: #201f20;
  --ima-auth-muted: #6f6b6c;
  --ima-auth-line: #ddd8d5;
  --ima-auth-paper: #f7f5f1;
  --ima-auth-white: #fff;
  --ima-auth-font: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", YuGothic, sans-serif;
}

html {
  min-width: 0;
  min-height: 100%;
  background: var(--ima-auth-paper);
}

body.ima-auth-screen {
  min-width: 0;
  min-height: 100vh;
  margin: 0;
  background: var(--ima-auth-paper);
  color: var(--ima-auth-ink);
  font-family: var(--ima-auth-font);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.ima-auth-screen *,
body.ima-auth-screen *::before,
body.ima-auth-screen *::after {
  box-sizing: border-box;
}

body.ima-auth-screen a {
  color: inherit;
  text-decoration: none;
}

body.ima-auth-screen button,
body.ima-auth-screen input {
  font: inherit;
}

body.ima-auth-screen :focus-visible {
  outline: 3px solid rgba(201, 32, 54, .22);
  outline-offset: 3px;
}

.ima-auth-sr-input {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
}

.ima-auth-shell {
  min-height: 100vh;
  display: grid;
}

.ima-auth-workspace {
  min-width: 0;
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: clamp(38px, 7vw, 90px);
  background:
    linear-gradient(rgba(32, 31, 32, .026) 1px, transparent 1px),
    linear-gradient(90deg, rgba(32, 31, 32, .026) 1px, transparent 1px),
    var(--ima-auth-paper);
  background-size: 32px 32px;
}

.ima-auth-panel {
  width: min(100%, 470px);
}

.ima-auth-heading {
  margin-bottom: 32px;
}

.ima-auth-heading > p {
  margin: 0 0 14px;
  color: var(--ima-auth-brand);
  font-size: 10px;
  font-weight: 750;
  letter-spacing: .19em;
}

.ima-auth-heading h1 {
  margin: 0 0 12px;
  color: var(--ima-auth-ink);
  font-family: "Yu Mincho", "Hiragino Mincho ProN", serif;
  font-size: clamp(30px, 3vw, 42px);
  font-weight: 600;
  letter-spacing: .015em;
  line-height: 1.22;
}

.ima-auth-heading > span {
  display: block;
  color: var(--ima-auth-muted);
  font-size: 13px;
  line-height: 1.75;
}

.ima-auth-message {
  margin: 0 0 22px;
  border-left: 3px solid;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .74);
  font-size: 13px;
  line-height: 1.65;
}

.ima-auth-message p {
  margin: 0;
}

.ima-auth-message p + p {
  margin-top: 5px;
}

.ima-auth-message.is-error {
  border-color: var(--ima-auth-brand);
  color: #79101f;
}

.ima-auth-message.is-success {
  border-color: #4e8058;
  color: #315c39;
}

.ima-auth-form {
  display: grid;
  gap: 22px;
  margin: 0;
}

.ima-auth-field {
  min-width: 0;
}

.ima-auth-field > label,
.ima-auth-label-row label {
  display: block;
  margin: 0 0 9px;
  color: #373435;
  font-size: 12px;
  font-weight: 650;
}

.ima-auth-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 9px;
}

.ima-auth-label-row label {
  margin: 0;
}

.ima-auth-label-row a {
  color: var(--ima-auth-brand);
  font-size: 11px;
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: rgba(201, 32, 54, .3);
  text-underline-offset: 3px;
}

.ima-auth-field > input,
.ima-auth-password {
  width: 100%;
  min-height: 54px;
  border: 1px solid var(--ima-auth-line);
  border-radius: 2px;
  background: rgba(255, 255, 255, .92);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .9), inset 0 1px 2px rgba(32, 31, 32, .025);
  transition: border-color .18s ease, box-shadow .18s ease, background-color .18s ease;
}

.ima-auth-field > input {
  padding: 0 16px;
  color: var(--ima-auth-ink);
  font-size: 16px;
}

.ima-auth-password {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  overflow: hidden;
}

.ima-auth-password input {
  min-width: 0;
  border: 0;
  padding: 0 14px 0 16px;
  outline: 0;
  background: transparent;
  color: var(--ima-auth-ink);
  font-size: 16px;
}

.ima-auth-password button {
  align-self: center;
  min-width: 54px;
  height: 34px;
  margin-right: 8px;
  border: 0;
  border-left: 1px solid var(--ima-auth-line);
  padding: 0 0 0 12px;
  background: transparent;
  color: var(--ima-auth-muted);
  font-size: 11px;
  font-weight: 650;
  cursor: pointer;
}

.ima-auth-field > input:focus,
.ima-auth-password:focus-within {
  border-color: rgba(201, 32, 54, .7);
  background: #fff;
  box-shadow: 0 0 0 3px rgba(201, 32, 54, .08);
  outline: 0;
}

.ima-auth-field-note {
  display: block;
  margin-top: 7px;
  color: var(--ima-auth-muted);
  font-size: 11px;
}

.ima-auth-check {
  width: max-content;
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--ima-auth-muted);
  font-size: 12px;
  cursor: pointer;
}

.ima-auth-check input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--ima-auth-brand);
}

.ima-auth-submit {
  width: 100%;
  min-height: 54px;
  display: grid;
  place-items: center;
  border: 1px solid var(--ima-auth-brand-deep);
  border-radius: 2px;
  padding: 0 22px;
  background: var(--ima-auth-brand);
  color: #fff;
  box-shadow: 0 8px 22px rgba(143, 20, 36, .15);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .08em;
  cursor: pointer;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
}

.ima-auth-submit:hover {
  background: var(--ima-auth-brand-deep);
  box-shadow: 0 10px 26px rgba(143, 20, 36, .2);
  transform: translateY(-1px);
}

.ima-auth-submit:active {
  box-shadow: 0 4px 12px rgba(143, 20, 36, .16);
  transform: translateY(0);
}

.ima-auth-submit-link {
  text-decoration: none;
}

.ima-auth-help,
.ima-auth-back {
  display: block;
  margin: 18px 0 0;
  color: var(--ima-auth-muted);
  font-size: 11px;
  line-height: 1.65;
  text-align: center;
}

.ima-auth-back {
  color: var(--ima-auth-brand);
  font-weight: 650;
  text-decoration: underline;
  text-decoration-color: rgba(201, 32, 54, .28);
  text-underline-offset: 4px;
}

@media (max-width: 920px) {
  .ima-auth-workspace {
    min-height: 100dvh;
    padding: 40px clamp(22px, 7vw, 56px);
  }
}

@media (max-width: 520px) {
  .ima-auth-workspace {
    padding: 22px 20px 42px;
    background-size: 24px 24px;
  }

  .ima-auth-heading {
    margin-bottom: 27px;
  }

  .ima-auth-heading h1 {
    font-size: 31px;
  }

  .ima-auth-label-row {
    align-items: center;
  }

  .ima-auth-field > input,
  .ima-auth-password,
  .ima-auth-submit {
    min-height: 52px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ima-auth-submit,
  .ima-auth-field > input,
  .ima-auth-password {
    transition: none;
  }
}
