/* MonoEdge - authentication screens (login / password reset / etc.)
   terminal / shopapp / brand で共通。1 本を 3 アプリに配っているので、
   直すときは 3 つとも (それぞれ staticadd/ と static/ の 2 箇所) を揃えること。 */

:root {
  --auth-ink: #10131a;
  --auth-ink-soft: #5b6471;
  --auth-line: #e3e6ec;
  --auth-field-bg: #f6f7f9;
  --auth-accent: #10131a;
  --auth-danger: #d0342c;
  --auth-radius: 14px;
}

* {
  box-sizing: border-box;
}

html,
body.login_body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

body.login_body {
  display: flex;
  /* 縦に積む。Reservation の base.html は messages と content が兵弟なので、
     row のままだと横に並んでしまう */
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: 32px 20px;
  color: var(--auth-ink);
  font-size: 14px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans",
    "Noto Sans JP", "Yu Gothic UI", Roboto, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  background-color: #0d0f14;
  background-image:
    radial-gradient(900px 520px at 12% -10%, rgba(94, 122, 255, 0.22), transparent 60%),
    radial-gradient(760px 520px at 92% 108%, rgba(0, 200, 178, 0.16), transparent 62%),
    linear-gradient(160deg, #131722 0%, #0d0f14 55%, #090a0e 100%);
  background-attachment: fixed;
}

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

/* ---------- card ----------
   カードは base.html の .auth-shell が持つ。allauth のテンプレートは
   ラッパーを持たないものが多く、カードをテンプレート側に置くと
   背景が暗いまま黒文字が乗って読めなくなるため。
   .auth-outer は shopapp / brand の base.html にある「白文字の外枠」。
   カードの中だけは必ず地の色に戻す。 */

.auth-outer {
  width: 100%;
  color: #ffffff;
}

.auth-shell {
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  color: var(--auth-ink);
  background: #ffffff;
  border-radius: 22px;
  padding: 40px 36px 32px 36px;
  box-shadow:
    0 1px 2px rgba(0, 0, 0, 0.18),
    0 32px 64px -24px rgba(0, 0, 0, 0.65);
}

.login-wrap {
  display: block;
}

/* ---------- brand ---------- */

.login-header {
  text-align: center;
  margin: 0 0 28px 0;
}

/* 横長のワードマーク (MonoEdge の SVG) 用 */
.login-header .logo {
  display: block;
  width: auto;
  height: 34px;
  max-width: 200px;
  margin: 0 auto 18px auto;
  object-fit: contain;
}

/* 正方形のアイコン (MONO TABLE / MONO OFFICE の PNG) 用。
   🔴 高さも幅も固定する。CSS が当たらない状態でも原寸 180px で暴れないこと。 */
.login-header .logo-tile {
  display: block;
  width: 62px;
  height: 62px;
  margin: 0 auto 18px auto;
  border: 1px solid var(--auth-line);
  border-radius: 15px;
  object-fit: contain;
}

.login-header .eyebrow {
  display: inline-block;
  padding: 5px 11px;
  border: 1px solid var(--auth-line);
  border-radius: 999px;
  color: var(--auth-ink-soft);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  line-height: 1;
}

.login-header .title1 {
  margin: 16px 0 6px 0;
  /* 日本語の見出し (「バックオフィスアプリ　ログイン」) が 420px のカードに収まる上限 */
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.3;
}

.login-header .subtitle {
  margin: 0;
  color: var(--auth-ink-soft);
  font-size: 13px;
  line-height: 1.6;
}

/* ---------- form ---------- */

.login-body {
  margin: 0;
}

.auth-field {
  margin: 0 0 16px 0;
}

.auth-field > label {
  display: block;
  margin: 0 0 7px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-ink-soft);
  letter-spacing: 0.02em;
}

.login_body input[type="text"],
.login_body input[type="password"],
.login_body input[type="email"] {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 16px;
  color: var(--auth-ink);
  font-size: 15px;
  font-family: inherit;
  background: var(--auth-field-bg);
  border: 1px solid var(--auth-line);
  border-radius: var(--auth-radius);
  outline: none;
  transition: border-color 0.15s, background 0.15s, box-shadow 0.15s;
}

.login_body input[type="text"]::placeholder,
.login_body input[type="password"]::placeholder,
.login_body input[type="email"]::placeholder {
  color: #a9b0bb;
}

.login_body input[type="text"]:hover,
.login_body input[type="password"]:hover,
.login_body input[type="email"]:hover {
  border-color: #cfd4dd;
}

.login_body input[type="text"]:focus,
.login_body input[type="password"]:focus,
.login_body input[type="email"]:focus {
  background: #ffffff;
  border-color: var(--auth-accent);
  box-shadow: 0 0 0 4px rgba(16, 19, 26, 0.08);
}

/* password field + reveal toggle */

.auth-field-inner {
  position: relative;
}

.auth-field-inner input[type="password"],
.auth-field-inner input[type="text"] {
  padding-right: 52px;
}

.auth-reveal {
  position: absolute;
  top: 50%;
  right: 6px;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
  background: transparent;
  border: 0;
  border-radius: 10px;
  color: #9aa2ae;
  cursor: pointer;
  transition: color 0.15s, background 0.15s;
}

.auth-reveal:hover {
  color: var(--auth-ink);
  background: rgba(16, 19, 26, 0.06);
}

.auth-reveal svg {
  width: 20px;
  height: 20px;
  display: block;
}

.auth-reveal .icon-off {
  display: none;
}

.auth-reveal.is-on .icon-on {
  display: none;
}

.auth-reveal.is-on .icon-off {
  display: block;
}

/* ---------- button ---------- */

.login_body button.login-btn,
.login_body input.login-btn,
.login_body a.login-btn {
  display: block;
  width: 100%;
  height: 50px;
  margin: 22px 0 0 0;
  padding: 0 16px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  line-height: 50px;
  text-align: center;
  letter-spacing: 0.01em;
  background: var(--auth-accent);
  border: 0;
  border-radius: var(--auth-radius);
  cursor: pointer;
  transition: transform 0.08s, box-shadow 0.15s, opacity 0.15s;
  box-shadow: 0 8px 18px -8px rgba(16, 19, 26, 0.75);
}

.login_body button.login-btn:hover,
.login_body input.login-btn:hover,
.login_body a.login-btn:hover {
  box-shadow: 0 12px 24px -8px rgba(16, 19, 26, 0.85);
}

.login_body button.login-btn:active,
.login_body input.login-btn:active,
.login_body a.login-btn:active {
  transform: translateY(1px);
}

/* ---------- links / footer ---------- */

.auth-links {
  margin: 20px 0 0 0;
  text-align: center;
}

.auth-links a,
a.secondaryAction {
  color: var(--auth-ink-soft);
  font-size: 13px;
  border-bottom: 1px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.auth-links a:hover,
a.secondaryAction:hover {
  color: var(--auth-ink);
  border-bottom-color: var(--auth-line);
}

.auth-foot {
  margin: 26px 0 0 0;
  padding: 18px 0 0 0;
  border-top: 1px solid var(--auth-line);
  color: #9aa2ae;
  font-size: 11px;
  text-align: center;
  letter-spacing: 0.02em;
}

/* ---------- messages / errors ---------- */

.auth-alert {
  margin: 0 0 18px 0;
  padding: 12px 14px;
  background: #fdf0ef;
  border: 1px solid #f6d3d0;
  border-radius: 12px;
  color: var(--auth-danger);
  font-size: 13px;
  line-height: 1.55;
}

.auth-alert ul {
  margin: 0;
  padding: 0 0 0 18px;
}

ul.errorlist {
  margin: 7px 0 0 2px;
  padding: 0;
  list-style: none;
}

ul.errorlist li {
  color: var(--auth-danger);
  font-size: 12px;
  line-height: 1.5;
}

.auth-field.has-error input[type="text"],
.auth-field.has-error input[type="password"],
.auth-field.has-error input[type="email"] {
  border-color: #efb8b4;
  background: #fdf7f6;
}

/* ---------- generic prose used by the other allauth pages ---------- */

.auth-shell p {
  margin: 0 0 14px 0;
  color: var(--auth-ink-soft);
  font-size: 13px;
  line-height: 1.7;
}

.auth-shell h1 {
  margin: 0 0 12px 0;
  font-size: 22px;
  font-weight: 700;
  color: var(--auth-ink);
}

.auth-shell form p {
  margin: 0 0 16px 0;
}

.auth-shell form p label {
  display: block;
  margin: 0 0 7px 2px;
  font-size: 12px;
  font-weight: 600;
  color: var(--auth-ink-soft);
}

/* 旧クラス (password_change 等) がカードの中で素直に並ぶようにする */

.change-password-title,
.change-password-container {
  margin: 0;
  padding: 0;
}

.change-password-button {
  margin: 20px 0 0 0;
}

.change-password-succeed-text {
  color: #0a7d55;
  font-weight: 600;
  font-size: 14px;
  text-align: center;
}

.back-to-home-link {
  margin: 18px 0 0 0;
  text-align: center;
}

.back-to-home-link-text {
  color: var(--auth-ink-soft);
  text-decoration: underline;
}

/* signup / logout など、書き直していないページの素の送信ボタンも拾う。
   .auth-reveal は type="button" なのでここには当たらない。 */
.login_body .btn,
.login_body button.btn-primary,
.login_body input[type="submit"],
.auth-shell form button[type="submit"] {
  display: block;
  width: 100%;
  height: 50px;
  margin: 0;
  padding: 0 16px;
  color: #ffffff;
  font-size: 15px;
  font-weight: 600;
  font-family: inherit;
  background: var(--auth-accent);
  border: 0;
  border-radius: var(--auth-radius);
  text-shadow: none;
  cursor: pointer;
}

@media (max-width: 480px) {
  body.login_body {
    padding: 20px 14px;
  }
  .auth-shell {
    padding: 32px 22px 26px 22px;
    border-radius: 18px;
  }
}
