/* Minimal theme-owned login surface. */

/* The parent theme paints every page with a fixed light background. Keep the
 * login route on the active palette so its shell cannot sit on a mismatched
 * canvas when dark mode is selected. */
body.kol-account-login-page {
  min-height: 100vh;
  background-color: var(--background);
  color: var(--foreground);
}

.kol-theme-login-page,
.kol-theme-login-page * {
  box-sizing: border-box;
}

.kol-theme-login-page {
  width: min(440px, calc(100% - 32px));
  margin-inline: auto;
  padding: clamp(2.5rem, 8vw, 5.5rem) 0 4rem;
  color: var(--foreground);
  direction: rtl;
}

.kol-theme-login__card {
  width: 100%;
  padding: clamp(1.5rem, 5vw, 2.25rem);
  border: 1px solid var(--border);
  border-radius: 0;
  color: var(--card-foreground, var(--foreground));
  background: var(--card);
}

.kol-theme-login__brand {
  display: flex;
  width: 100%;
  max-width: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .6rem;
  overflow-wrap: anywhere;
  margin-block-end: 2.25rem;
  font-size: .78rem;
  font-weight: 800;
  letter-spacing: .08em;
  text-align: center;
}

.kol-theme-login__brand img {
  display: block;
  width: auto;
  max-width: min(150px, 42vw);
  height: auto;
  max-height: 44px;
  flex: 0 1 auto;
  object-fit: contain;
}

.kol-theme-login__brand span {
  min-width: 0;
}

.kol-theme-login__heading {
  margin-block-end: 1.75rem;
}

.kol-theme-login__eyebrow {
  margin: 0 0 .55rem;
  color: var(--primary);
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .08em;
}

.kol-theme-login__heading h1 {
  margin: 0 0 .6rem;
  color: inherit;
  font-family: var(--kol-font-ui), Georgia, serif;
  font-size: clamp(2rem, 7vw, 2.8rem);
  font-weight: 400;
  line-height: 1.15;
}

.kol-theme-login__heading p:last-child {
  margin: 0;
  color: var(--muted-foreground);
  font-size: .9rem;
  line-height: 1.7;
}

.kol-theme-login__form {
  display: grid;
  gap: 1rem;
  margin: 0;
}

.kol-theme-login__field {
  position: relative;
  display: block;
  width: 100%;
  height: 54px;
  margin: 0;
  padding: 0;
  border: 1px solid var(--s13-control-border, var(--border));
  border-radius: 0;
  color: var(--foreground);
  background: var(--s13-control-surface, var(--background));
  transition: border-color 140ms ease;
}

.kol-theme-login__field:hover,
.kol-theme-login__field:focus-within {
  border-color: var(--primary, #6d0015);
}

.kol-theme-login__field:focus-within {
  outline: none !important;
  outline-offset: 0;
}

.kol-theme-login__field > input {
  width: 100%;
  height: 100%;
  min-height: 0;
  margin: 0;
  padding: 15px .75rem 7px;
  border: 0 !important;
  border-radius: 0 !important;
  color: var(--foreground);
  background: transparent !important;
  font: inherit;
  line-height: 1.2;
  outline: 0 !important;
  box-shadow: none !important;
  caret-color: var(--primary, #6d0015);
}

.kol-theme-login__field > input::placeholder {
  color: transparent;
}

.kol-theme-login__field-label {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-start: .75rem;
  max-width: calc(100% - 1.5rem);
  padding: 0;
  overflow: hidden;
  color: var(--s13-control-muted, var(--muted-foreground));
  font-size: .8rem;
  font-weight: 400;
  line-height: 1.4;
  pointer-events: none;
  text-overflow: ellipsis;
  transform: translateY(-50%);
  transition: inset-block-start 140ms ease, transform 140ms ease, padding 140ms ease, color 140ms ease, font-size 140ms ease;
  white-space: nowrap;
}

.kol-theme-login__field > input:focus + .kol-theme-login__field-label,
.kol-theme-login__field > input:not(:placeholder-shown) + .kol-theme-login__field-label {
  inset-block-start: 0;
  padding-inline: .4375rem;
  color: var(--primary, #6d0015);
  background: var(--s13-control-surface, var(--background));
  font-size: .625rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  transform: translateY(-50%);
}

.kol-theme-login__password-toggle {
  /* This icon control intentionally owns its surface instead of using the
   * site's shared button component. */
  position: absolute !important;
  inset-block-start: 50%;
  inset-inline-end: .35rem;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  min-width: 36px;
  height: 36px;
  min-height: 36px;
  padding: 0;
  transform: translateY(-50%);
  appearance: none;
  border: 0 !important;
  border-radius: 0 !important;
  background: transparent !important;
  background-color: transparent !important;
  box-shadow: none !important;
  color: var(--muted-foreground) !important;
  cursor: pointer;
  font: inherit;
  letter-spacing: normal;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  transition: color 140ms ease;
  vertical-align: middle;
}

.kol-theme-login__field--password > input {
  padding-inline-end: 3rem;
}

.kol-theme-login__password-toggle:hover,
.kol-theme-login__password-toggle:focus-visible {
  background-color: transparent !important;
  color: var(--primary) !important;
}

.kol-theme-login__password-toggle:focus-visible {
  outline: 1px solid var(--primary);
  outline-offset: 2px;
}

.kol-theme-login__password-icon {
  display: none;
}

.kol-theme-login__password-toggle:not([aria-pressed="true"]) .kol-theme-login__password-icon--show,
.kol-theme-login__password-toggle[aria-pressed="true"] .kol-theme-login__password-icon--hide {
  display: block;
}

.kol-theme-login__password-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-width: 1.7;
}

.kol-theme-login__options {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .5rem .75rem;
  min-width: 0;
  color: var(--muted-foreground);
  font-size: .78rem;
}

.kol-theme-login__remember {
  display: inline-flex;
  align-items: center;
  gap: .45rem;
  cursor: pointer;
}

.kol-theme-login__remember input {
  width: 16px;
  height: 16px;
  margin: 0;
  border-color: var(--primary);
  color: var(--primary);
  background-color: var(--background);
}

/* System 13 intentionally uses a centered currentColor mark. On a primary
 * custom checkbox that color is the light content token, so the mark can
 * disappear against the light login surface. Restore a clear checked state
 * for this form: primary square, visible light check. */
.kol-theme-login__remember input.kol-ui-checkbox:checked {
  border-color: var(--primary);
  color: var(--primary-foreground);
  background-color: var(--primary) !important;
  background-image: none !important;
}

.kol-theme-login__remember input.kol-ui-checkbox:checked::before {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  content: "✓";
  clip-path: none;
  background: none;
  box-shadow: none;
  color: var(--primary-foreground);
  font-size: .72rem;
  font-weight: 800;
  line-height: 1;
  opacity: 1;
  rotate: 0deg;
  translate: 0;
}

.kol-theme-login__link {
  min-width: 0;
  font-weight: 700;
}

.kol-theme-login__link:hover {
  text-decoration-thickness: 2px;
}

.kol-theme-login__message {
  margin: 0;
  font-size: .8rem;
  line-height: 1.55;
}

.kol-theme-login__message[hidden] {
  display: none;
}

.kol-theme-login__submit {
  width: 100%;
  min-height: 48px;
  margin-block-start: .25rem;
  font-weight: 800;
}

.kol-theme-login__submit:disabled {
  cursor: wait;
  opacity: .7;
}

.kol-theme-login__footer {
  margin: 1.5rem 0 0;
  color: var(--muted-foreground);
  font-size: .82rem;
  line-height: 1.6;
  text-align: center;
}

.kol-theme-login__signed-in {
  text-align: center;
}

.kol-theme-login__signed-in .kol-theme-login__brand {
  margin-block-end: 1.5rem;
}

.kol-theme-login__signed-in .kol-theme-login__submit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

@media (max-width: 480px) {
  .kol-theme-login-page {
    width: min(100% - 24px, 440px);
    padding-top: 2rem;
  }

  .kol-theme-login__card {
    padding: 1.35rem;
  }

  .kol-theme-login__brand {
    margin-block-end: 1.75rem;
  }
}
