/* QRS sign-in pages (store owners and super admin). Same brand colours as the landing page. */

:root {
  --au-brand: #6c4197;
  --au-brand-light: #8a6aad;
  --au-brand-deep: #36124f;
  --au-brand-ink: #24092f;
  --au-tint: #f5f0fa;
  --au-ink: #1f1330;
  --au-muted: #5e5270;
  --au-line: #e4dcee;
  --au-red: #b42339;
  --au-red-bg: #fdecef;
  --au-green: #1f7a52;
  --au-green-bg: #e7f6ee;
  --au-ease: cubic-bezier(0.22, 1, 0.36, 1);
}

*,
*::before,
*::after { box-sizing: border-box; }

html, body { height: 100%; }

body.au {
  margin: 0;
  font-family: "Raleway", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--au-ink);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--au-brand); text-decoration: none; }
a:hover { color: var(--au-brand-deep); text-decoration: underline; }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--au-brand-light); outline-offset: 2px; }

.au-wrap {
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: 100vh;
}

/* ---------- Brand side ---------- */

.au-brand {
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  padding: 40px 56px;
  color: #fff;
  background:
    radial-gradient(120% 80% at 100% 0%, rgba(138, 106, 173, 0.55) 0%, transparent 60%),
    radial-gradient(90% 70% at 0% 100%, rgba(108, 65, 151, 0.6) 0%, transparent 65%),
    linear-gradient(160deg, var(--au-brand-ink) 0%, var(--au-brand-deep) 55%, #4d2273 100%);
}

/* Soft QR-like grid in the background */
.au-brand::after {
  content: "";
  position: absolute;
  right: -80px;
  bottom: -80px;
  width: 360px;
  height: 360px;
  border-radius: 48px;
  opacity: 0.05;
  background:
    linear-gradient(90deg, #fff 18px, transparent 18px) 0 0 / 36px 36px,
    linear-gradient(#fff 18px, transparent 18px) 0 0 / 36px 36px;
  transform: rotate(-12deg);
  pointer-events: none;
}

.au-logo img { display: block; height: 48px; width: auto; }

.au-brand-body {
  position: relative;
  z-index: 1;
  margin: auto 0;
  padding: 48px 0;
  max-width: 460px;
}

.au-eyebrow {
  display: inline-block;
  margin-bottom: 16px;
  padding: 5px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.au-brand h2 {
  margin: 0 0 14px;
  font-size: clamp(28px, 3vw, 38px);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.au-brand p { margin: 0 0 28px; color: rgba(255, 255, 255, 0.82); font-size: 17px; }

.au-points { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; }

.au-points li {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  font-size: 15px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.92);
}

.au-points svg {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  padding: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.16);
}

.au-brand-foot {
  position: relative;
  z-index: 1;
  font-size: 13px;
  color: rgba(255, 255, 255, 0.6);
}

.au-brand-foot a { color: rgba(255, 255, 255, 0.85); }

/* ---------- Form side ---------- */

.au-panel {
  display: flex;
  flex-direction: column;
  padding: 32px 24px;
  background: linear-gradient(180deg, #fbf9fd 0%, #fff 40%);
}

.au-panel-top {
  display: flex;
  justify-content: flex-end;
  gap: 4px;
  font-size: 14px;
  color: var(--au-muted);
}

.au-form-box {
  width: 100%;
  max-width: 400px;
  margin: auto;
  padding: 40px 0;
  animation: au-in 0.5s var(--au-ease) both;
}

@keyframes au-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

.au-form-box h1 {
  margin: 0 0 6px;
  font-size: 30px;
  font-weight: 800;
  letter-spacing: -0.01em;
  line-height: 1.2;
}

.au-lead { margin: 0 0 28px; color: var(--au-muted); font-size: 15px; }

.au-alert {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-bottom: 20px;
  padding: 12px 14px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 500;
  background: var(--au-red-bg);
  color: var(--au-red);
}

.au-alert svg { flex-shrink: 0; width: 18px; height: 18px; margin-top: 1px; }
.au-alert.is-success { background: var(--au-green-bg); color: var(--au-green); }

.au-field { margin-bottom: 18px; }

.au-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.au-label {
  display: block;
  margin-bottom: 7px;
  font-size: 14px;
  font-weight: 700;
}

.au-label-row .au-label { margin-bottom: 0; }
.au-label-row a { font-size: 13px; font-weight: 600; }

.au-input-wrap { position: relative; }

.au-input-wrap > svg {
  position: absolute;
  left: 14px;
  top: 50%;
  width: 18px;
  height: 18px;
  transform: translateY(-50%);
  color: #9a8fae;
  pointer-events: none;
}

.au-input {
  display: block;
  width: 100%;
  height: 50px;
  padding: 0 14px 0 44px;
  border: 1.5px solid var(--au-line);
  border-radius: 12px;
  background: #fff;
  color: var(--au-ink);
  font: inherit;
  font-size: 16px; /* 16px stops iOS zooming in */
  transition: border-color 0.15s, box-shadow 0.15s;
}

.au-input::placeholder { color: #a79dba; }
.au-input:hover { border-color: #cfc3df; }

.au-input:focus {
  outline: none;
  border-color: var(--au-brand);
  box-shadow: 0 0 0 4px rgba(108, 65, 151, 0.14);
}

.au-input.is-invalid { border-color: var(--au-red); }
.au-input.is-invalid:focus { box-shadow: 0 0 0 4px rgba(180, 35, 57, 0.12); }

/* Show / Hide button added by layouts.render.password_toggle */
.au .pw-toggle-btn { right: 10px; }

.au-check {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 2px 0 24px;
  font-size: 14px;
  font-weight: 500;
  color: var(--au-muted);
  cursor: pointer;
  user-select: none;
}

.au-check input {
  width: 18px;
  height: 18px;
  margin: 0;
  accent-color: var(--au-brand);
}

.au-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  height: 52px;
  border: 0;
  border-radius: 12px;
  background: var(--au-brand);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(108, 65, 151, 0.28);
  transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.au-btn:hover { background: #5a3482; box-shadow: 0 10px 24px rgba(108, 65, 151, 0.34); }
.au-btn:active { transform: translateY(1px); }
.au-btn[disabled] { opacity: 0.8; cursor: progress; }

.au-spinner {
  display: none;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 255, 255, 0.4);
  border-top-color: #fff;
  border-radius: 50%;
  animation: au-spin 0.7s linear infinite;
}

.au-btn.is-busy .au-spinner { display: inline-block; }

@keyframes au-spin { to { transform: rotate(360deg); } }

.au-switch {
  margin: 24px 0 0;
  text-align: center;
  font-size: 15px;
  color: var(--au-muted);
}

.au-switch a { font-weight: 700; }

.au-legal {
  text-align: center;
  font-size: 12px;
  color: #8d82a0;
}

/* ---------- Small screens ---------- */

@media (max-width: 899.98px) {
  .au-wrap { grid-template-columns: 1fr; }

  .au-brand {
    padding: 20px 20px 28px;
  }

  .au-brand::after { width: 220px; height: 220px; right: -60px; bottom: -90px; }
  .au-logo img { height: 40px; }
  .au-brand-body { padding: 20px 0 0; margin: 0; }
  .au-brand h2 { font-size: 24px; margin-bottom: 6px; }
  .au-brand p { margin: 0; font-size: 15px; }
  .au-points, .au-brand-foot, .au-eyebrow { display: none; }

  .au-panel { padding: 8px 20px 24px; }
  .au-panel-top { display: none; }
  .au-form-box { padding: 28px 0 32px; }
  .au-form-box h1 { font-size: 26px; }
}

@media (prefers-reduced-motion: reduce) {
  .au-form-box { animation: none; }
  .au-btn, .au-input { transition: none; }
}

/* ---------- Sign-up ---------- */
.au-hp { position: absolute; left: -10000px; top: auto; width: 1px; height: 1px; overflow: hidden; }
.au-hint { margin: 6px 2px 0; font-size: 13px; color: var(--au-muted); line-height: 1.45; }
.au-hint.is-error { color: var(--au-red); font-weight: 600; }
.au-hint[hidden] { display: none; }
.au-hint a { font-weight: 700; }
.au-suggest { padding: 0; border: 0; background: none; color: var(--au-brand); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }

.au-fieldset { margin-inline: 0; padding: 0; border: 0; min-width: 0; }
.au-fieldset legend { padding: 0; }
.au-types { display: flex; flex-wrap: wrap; gap: 8px; border-radius: 12px; }
.au-types.is-invalid { outline: 1.5px solid var(--au-red); outline-offset: 4px; }
.au-type { position: relative; cursor: pointer; }
.au-type input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.au-type span {
  display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; white-space: nowrap;
  border: 1.5px solid var(--au-line); border-radius: 12px; background: #fff;
  font-size: 14px; font-weight: 600; color: var(--au-ink); transition: border-color .15s, background-color .15s;
}
.au-type svg { flex-shrink: 0; width: 18px; height: 18px; color: #9a8fae; }
.au-type:hover span { border-color: #cfc3df; }
.au-type input:checked + span { border-color: var(--au-brand); background: var(--au-tint); color: var(--au-brand-deep); }
.au-type input:checked + span svg { color: var(--au-brand); }
.au-type input:focus-visible + span { outline: 2px solid var(--au-brand-light); outline-offset: 2px; }

.au-has-prefix .au-input { padding-left: 58px; }
.au-prefix {
  position: absolute; left: 1.5px; top: 1.5px; bottom: 1.5px; display: flex; align-items: center; padding: 0 10px 0 14px;
  border-right: 1px solid var(--au-line); border-radius: 11px 0 0 11px; background: var(--au-tint);
  font-size: 15px; font-weight: 700; color: var(--au-muted); pointer-events: none;
}
.au-upper { text-transform: uppercase; }
.au-upper::placeholder { text-transform: none; }

.au-rules { display: flex; flex-wrap: wrap; gap: 6px 14px; margin: 8px 2px 0; padding: 0; list-style: none; font-size: 13px; color: var(--au-muted); }
.au-rules li { display: inline-flex; align-items: center; gap: 6px; }
.au-rules li::before { content: ""; width: 14px; height: 14px; border: 1.5px solid #c9bfd8; border-radius: 50%; box-sizing: border-box; }
.au-rules li.is-met { color: var(--au-green); }
.au-rules li.is-met::before { border: 0; background: var(--au-green) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='4' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E") center / 10px no-repeat; }

.au-ref summary { display: inline-block; margin-bottom: 4px; font-size: 14px; font-weight: 600; color: var(--au-brand); cursor: pointer; list-style: none; }
.au-ref summary::-webkit-details-marker { display: none; }
.au-ref summary::after { content: " +"; }
.au-ref[open] summary::after { content: " −"; }
.au-ref[open] summary { margin-bottom: 8px; }

.au-terms { align-items: flex-start; margin: 4px 0 20px; line-height: 1.45; cursor: default; }
.au-terms input { flex-shrink: 0; margin-top: 1px; cursor: pointer; }
.au-terms a { font-weight: 700; }
.au-terms.is-invalid { color: var(--au-red); }
.au-terms-msg { margin: -14px 0 16px 28px; }
