/* TOYMORI test-site login — namespaced so V1 / V2 / CN headers stay intact */
.tm-auth-slot {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  gap: 10px;
}

.tm-auth-login-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 14px;
  border: 1.5px solid transparent;
  border-radius: 999px;
  color: var(--ink, #1f1f1f);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tm-auth-login-link:hover,
.tm-auth-login-link:focus-visible {
  color: var(--ink, #1f1f1f);
  background: var(--cream, #f5ede2);
}

.tm-auth-login-link[aria-current="page"] {
  border-color: var(--line-strong, rgba(31, 31, 31, 0.28));
  background: var(--cream, #f5ede2);
}

.tm-auth-signed {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 40px;
  max-width: 100%;
  padding: 0 4px 0 12px;
  border: 1.5px solid var(--line-strong, rgba(31, 31, 31, 0.28));
  border-radius: 999px;
  background: var(--cream, #f5ede2);
}

.tm-auth-slot.is-signed .tm-auth-login-link {
  display: none;
}

.tm-auth-slot.is-signed .tm-auth-signed {
  display: inline-flex;
}

.tm-auth-name {
  max-width: 9.5em;
  overflow: hidden;
  color: var(--ink, #1f1f1f);
  font-size: 12px;
  font-weight: 700;
  line-height: 1.2;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tm-auth-logout {
  min-height: 32px;
  padding: 0 12px;
  border: 0;
  border-radius: 999px;
  color: var(--muted, #706a61);
  font-size: 12px;
  font-weight: 700;
  line-height: 1;
  background: transparent;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.tm-auth-logout:hover,
.tm-auth-logout:focus-visible {
  color: var(--ink, #1f1f1f);
  background: var(--paper, #fffdf8);
}

@media (max-width: 960px) {
  .nav-shell > .tm-auth-slot {
    margin-left: auto;
  }

  .nav-shell > .menu-toggle {
    margin-left: 8px;
  }
}

@media (max-width: 520px) {
  .tm-auth-login-link {
    min-height: 36px;
    padding: 0 10px;
  }

  .tm-auth-signed {
    min-height: 36px;
    padding-left: 10px;
  }

  .tm-auth-name {
    max-width: 6.2em;
  }
}

/* Page + modal shared panel */
.tm-auth-page {
  min-height: calc(100vh - 76px);
  padding: 56px 0 80px;
  background:
    radial-gradient(circle at 12% 0%, rgba(255, 122, 77, 0.12), transparent 36%),
    var(--cream, #f5ede2);
}

.tm-auth-page-inner {
  width: min(520px, calc(100% - 64px));
  margin: 0 auto;
}

.tm-auth-dialog {
  width: min(520px, calc(100% - 32px));
  max-height: calc(100vh - 32px);
  padding: 0;
  border: 0;
  background: transparent;
  overflow: auto;
}

.tm-auth-dialog::backdrop {
  background: rgba(31, 31, 31, 0.46);
}

.tm-auth-card {
  position: relative;
  padding: 36px 32px 28px;
  border: 1.5px solid var(--ink, #1f1f1f);
  border-radius: 28px;
  background: var(--paper, #fffdf8);
  box-shadow: 8px 8px 0 var(--coral, #ff7a4d);
}

.tm-auth-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1.5px solid var(--ink, #1f1f1f);
  border-radius: 50%;
  color: var(--ink, #1f1f1f);
  font-size: 22px;
  line-height: 1;
  background: transparent;
  cursor: pointer;
}

.tm-auth-close:hover,
.tm-auth-close:focus-visible {
  color: var(--paper, #fffdf8);
  background: var(--ink, #1f1f1f);
}

.tm-auth-kicker {
  margin: 0 0 10px;
  color: var(--muted, #706a61);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.18em;
}

.tm-auth-card h1,
.tm-auth-card h2 {
  margin: 0 0 10px;
  font-family: var(--display, "Baloo 2", "Arial Rounded MT Bold", sans-serif);
  font-size: clamp(32px, 5vw, 42px);
  font-weight: 800;
  line-height: 0.95;
  letter-spacing: -0.04em;
}

.tm-auth-lead {
  margin: 0 0 26px;
  color: var(--muted, #706a61);
  font-size: 14px;
  line-height: 1.7;
}

.tm-auth-form {
  display: grid;
  gap: 16px;
}

.tm-auth-field {
  display: grid;
  gap: 8px;
}

.tm-auth-field label {
  font-size: 12px;
  font-weight: 700;
  color: var(--ink, #1f1f1f);
}

.tm-auth-phone {
  display: flex;
  align-items: stretch;
  overflow: hidden;
  border: 1.5px solid var(--line-strong, rgba(31, 31, 31, 0.28));
  border-radius: 13px;
  background: var(--paper, #fffdf8);
}

.tm-auth-phone:focus-within {
  border-color: var(--ink, #1f1f1f);
  box-shadow: 0 0 0 3px var(--coral-soft, #ffd8c8);
}

.tm-auth-prefix {
  display: inline-flex;
  align-items: center;
  padding: 0 12px;
  border-right: 1.5px solid var(--line, rgba(31, 31, 31, 0.14));
  color: var(--muted, #706a61);
  font-size: 13px;
  font-weight: 700;
  background: var(--cream, #f5ede2);
}

.tm-auth-phone input,
.tm-auth-field > input {
  width: 100%;
  min-width: 0;
  min-height: 50px;
  padding: 0 15px;
  border: 0;
  border-radius: 13px;
  color: var(--ink, #1f1f1f);
  font-size: 14px;
  background: transparent;
}

.tm-auth-field > input {
  border: 1.5px solid var(--line-strong, rgba(31, 31, 31, 0.28));
  background: var(--paper, #fffdf8);
}

.tm-auth-phone input:focus,
.tm-auth-field > input:focus {
  outline: none;
}

.tm-auth-field > input:focus {
  border-color: var(--ink, #1f1f1f);
  box-shadow: 0 0 0 3px var(--coral-soft, #ffd8c8);
}

.tm-auth-error {
  min-height: 1.4em;
  margin: 0;
  color: #a33b1f;
  font-size: 13px;
  line-height: 1.5;
}

.tm-auth-error:empty {
  display: none;
}

.tm-auth-actions {
  display: grid;
  gap: 10px;
  margin-top: 6px;
}

.tm-auth-actions .btn {
  width: 100%;
}

.tm-auth-submit[disabled] {
  opacity: 0.65;
  cursor: wait;
}

.tm-auth-switch {
  margin: 4px 0 0;
  color: var(--muted, #706a61);
  font-size: 13px;
  line-height: 1.6;
  text-align: center;
}

.tm-auth-switch button {
  padding: 0;
  border: 0;
  border-bottom: 1px solid var(--line-strong, rgba(31, 31, 31, 0.28));
  color: var(--ink, #1f1f1f);
  font-size: inherit;
  font-weight: 700;
  background: none;
  cursor: pointer;
}

.tm-auth-switch button:hover,
.tm-auth-switch button:focus-visible {
  border-color: var(--ink, #1f1f1f);
}

.tm-auth-hint {
  margin: 18px 0 0;
  color: var(--muted, #706a61);
  font-size: 11px;
  line-height: 1.7;
}

.tm-auth-success {
  display: none;
}

.tm-auth-card.is-success .tm-auth-form,
.tm-auth-card.is-success .tm-auth-switch,
.tm-auth-card.is-success .tm-auth-lead,
.tm-auth-card.is-register .tm-auth-success {
  display: none;
}

.tm-auth-card.is-success .tm-auth-success {
  display: block;
}

.tm-auth-card.is-success .tm-auth-hint {
  margin-top: 0;
}

.tm-auth-continue {
  margin-top: 22px;
}

@media (max-width: 520px) {
  .tm-auth-page {
    padding: 36px 0 64px;
  }

  .tm-auth-page-inner {
    width: calc(100% - 40px);
  }

  .tm-auth-card {
    padding: 28px 20px 22px;
    border-radius: 22px;
    box-shadow: 5px 5px 0 var(--coral, #ff7a4d);
  }

  .tm-auth-card h1,
  .tm-auth-card h2 {
    font-size: 30px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tm-auth-login-link,
  .tm-auth-logout,
  .tm-auth-close,
  .tm-auth-phone,
  .tm-auth-field > input {
    transition: none;
  }
}
