/* ============================================
   LottoHaus Portal — Auth pages (login / signup)
   Uses the same brand tokens from home.css
   ============================================ */

.auth-body {
  min-height: 100vh;
  background: var(--bg-light);
}

.auth-shell {
  display: grid;
  grid-template-columns: 1fr 1.1fr;
  min-height: 100vh;
}

/* ---- Left brand panel ---- */

.auth-brand {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 20% 15%, rgba(251, 113, 133, 0.18), transparent 55%),
    linear-gradient(155deg, var(--brand-primary-deep) 0%, var(--brand-primary) 100%);
  color: #fff;
  padding: 56px 56px;
  display: flex;
  flex-direction: column;
  /* Top-aligned, not centred. This panel is a grid item stretched to the
     height of the taller column, so on the signup page -- whose form runs for
     several screens -- centring pushed the logo halfway down the page instead
     of putting it where the eye lands first. */
  justify-content: flex-start;
}

.auth-brand::after {
  content: '';
  position: absolute;
  bottom: -18%;
  left: -22%;
  width: 520px;
  height: 520px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.05);
  pointer-events: none;
}

.auth-logo {
  position: relative;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  margin-bottom: 48px;
  align-self: flex-start;
}

/* Dark artwork on a white plate, so it reads against the navy auth panel. */
.auth-logo-img {
  height: 60px;
  width: auto;
  object-fit: contain;
  padding: 10px 16px;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.3);
}

.auth-brand-title {
  position: relative;
  z-index: 1;
  font-size: 2.1rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  margin-bottom: 18px;
  max-width: 420px;
}

.auth-brand-text {
  position: relative;
  z-index: 1;
  font-size: 1.02rem;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 34px;
  max-width: 420px;
}

.auth-points {
  position: relative;
  z-index: 1;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 14px;
  max-width: 420px;
}

.auth-points li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14.5px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.9);
}

.auth-points li::before {
  content: '';
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background-color: var(--brand-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5'%3E%3Cpolyline points='20 6 9 17 4 12'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
  background-size: 12px;
}

/* ---- Right form panel ---- */

.auth-main {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 56px 32px;
  overflow-y: auto;
}

.auth-card {
  width: 100%;
  max-width: 560px;
}

.auth-back {
  display: inline-block;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
  margin-bottom: 26px;
  transition: var(--transition);
}

.auth-back:hover {
  color: var(--brand-primary);
  transform: translateX(-3px);
}

.auth-title {
  font-size: 2rem;
  letter-spacing: -0.025em;
  color: var(--text-dark);
  margin-bottom: 10px;
}

.auth-sub {
  font-size: 14.5px;
  color: var(--text-muted);
  margin-bottom: 26px;
  line-height: 1.6;
}

.req {
  color: var(--brand-accent);
  font-weight: 700;
}

/* ---- Alerts ---- */

.auth-alert {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 13px 15px;
  border-radius: var(--radius-sm);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.55;
  margin-bottom: 20px;
}
.auth-alert svg { flex-shrink: 0; margin-top: 1px; }
.auth-alert-error {
  background: rgba(220, 38, 38, 0.07);
  border: 1px solid rgba(220, 38, 38, 0.22);
  color: #b91c1c;
}

/* ---- Grouped field blocks ---- */

.auth-block {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  margin-bottom: 20px;
  overflow: hidden;
}

.auth-block-head {
  padding: 15px 24px;
  border-bottom: 1.5px solid var(--border);
  background: linear-gradient(180deg, rgba(11, 61, 145, 0.04), transparent);
}

.auth-block-title {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--brand-primary);
}

.auth-block-body { padding: 22px 24px 6px; }

/* ---- Row: remember me / forgot ---- */

.auth-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin: 2px 0 20px;
}
.auth-row .check-row { margin-bottom: 0; }

.auth-link {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--brand-primary);
  white-space: nowrap;
}
.auth-link:hover { text-decoration: underline; }

/* ============================================
   FORM CONTROLS
   The auth pages reuse the app's .form-* class
   names, but they need a larger, softer treatment
   than the 40px dashboard inputs. Everything here
   is scoped to .auth-card so it cannot leak.
   ============================================ */

.auth-card .form-group { margin-bottom: 20px; }

.auth-card .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  margin-bottom: 8px;
  letter-spacing: 0.005em;
}

.auth-card .form-req { color: var(--brand-accent); font-weight: 700; }

.auth-card .form-input,
.auth-card input[type="text"],
.auth-card input[type="email"],
.auth-card input[type="password"],
.auth-card input[type="tel"],
.auth-card input[type="number"],
.auth-card select,
.auth-card textarea {
  width: 100%;
  font-family: inherit;
  font-size: 15px;
  font-weight: 500;
  color: var(--text-dark);
  background: var(--white);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px 15px;
  height: 50px;
  appearance: none;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.auth-card textarea {
  height: auto;
  min-height: 96px;
  padding: 13px 15px;
  line-height: 1.6;
  resize: vertical;
}

.auth-card select {
  cursor: pointer;
  padding-right: 42px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%235c6f85' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 15px center;
}

.auth-card input::placeholder,
.auth-card textarea::placeholder { color: #9aa8b8; font-weight: 400; }

.auth-card .form-input:hover:not(:disabled),
.auth-card input[type="text"]:hover:not(:disabled),
.auth-card input[type="email"]:hover:not(:disabled),
.auth-card input[type="password"]:hover:not(:disabled),
.auth-card input[type="tel"]:hover:not(:disabled),
.auth-card select:hover:not(:disabled) {
  border-color: #b9c6d4;
}

.auth-card .form-input:focus,
.auth-card input[type="text"]:focus,
.auth-card input[type="email"]:focus,
.auth-card input[type="password"]:focus,
.auth-card input[type="tel"]:focus,
.auth-card input[type="number"]:focus,
.auth-card select:focus,
.auth-card textarea:focus {
  outline: none;
  border-color: var(--brand-primary);
  box-shadow: 0 0 0 4px rgba(11, 61, 145, 0.12);
}

.auth-card .form-error {
  display: block;
  font-size: 12.5px;
  font-weight: 600;
  color: #b91c1c;
  margin-top: 7px;
}

.auth-card .form-group.has-error .form-input,
.auth-card .form-group.has-error input,
.auth-card .form-group.has-error select {
  border-color: #dc2626;
  background: rgba(220, 38, 38, 0.02);
}
.auth-card .form-group.has-error .form-input:focus,
.auth-card .form-group.has-error input:focus,
.auth-card .form-group.has-error select:focus {
  border-color: #dc2626;
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

/* ---- Checkbox ---- */

.auth-card .check-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.auth-card .check-row label {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.55;
  cursor: pointer;
}
.auth-card input[type="checkbox"] {
  width: 18px;
  height: 18px;
  margin: 1px 0 0;
  accent-color: var(--brand-primary);
  flex-shrink: 0;
  cursor: pointer;
}

/* ---- Password reveal button ---- */

.auth-pw { position: relative; }
.auth-pw .form-input { padding-right: 52px; }

.auth-pw-toggle {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  color: var(--text-muted);
  background: transparent;
  border: none;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: color 0.15s ease, background 0.15s ease;
}
.auth-pw-toggle:hover { color: var(--brand-primary); background: rgba(11, 61, 145, 0.06); }
.auth-pw-toggle:focus-visible { outline: 2px solid var(--brand-primary); outline-offset: 1px; }

/* ---- Password strength meter (signup) ---- */

.auth-strength { margin: -8px 0 20px; }
.auth-strength-bar {
  height: 5px;
  border-radius: 3px;
  background: rgba(15, 35, 60, 0.09);
  overflow: hidden;
}
.auth-strength-fill {
  height: 100%;
  width: 0;
  border-radius: 3px;
  background: #dc2626;
  /* The signup script animates width/background inline as the user types. */
  transition: width 0.25s ease, background 0.25s ease;
}
.auth-strength-text {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  margin-top: 6px;
}

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

.auth-card .btn-block {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  width: 100%;
  min-height: 52px;
  font-size: 15.5px;
  font-weight: 700;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: transform 0.16s ease, box-shadow 0.16s ease, filter 0.16s ease;
}
.auth-card .btn-block:hover { transform: translateY(-1px); }
.auth-card .btn-block:active { transform: translateY(0); }
.auth-card .btn-block:disabled { opacity: 0.65; cursor: not-allowed; transform: none; }

.auth-alt {
  font-size: 14.5px;
  color: var(--text-muted);
  text-align: center;
}

.auth-alt a {
  color: var(--brand-primary);
  font-weight: 700;
}

.auth-alt a:hover {
  text-decoration: underline;
}

/* ============================================
   SIGNUP WIZARD — numbered progress
   ============================================ */

.wizard-steps {
  list-style: none;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  margin: 6px 0 0;
  padding: 0;
  position: relative;
}

/* The connector line sits behind the numbered discs and is drawn only as far
   as the completed portion, so it reads as progress rather than decoration. */
.wizard-steps::before,
.wizard-steps::after {
  content: '';
  position: absolute;
  top: 15px;
  height: 2px;
  border-radius: 2px;
  pointer-events: none;
}

.wizard-steps::before {
  left: 15px;
  right: 15px;
  background: var(--border);
}

.wizard-steps::after {
  left: 15px;
  width: calc((100% - 30px) * var(--wizard-done, 0));
  background: var(--brand-accent);
  transition: width 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.wizard-step {
  position: relative;
  z-index: 1;
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
  text-align: center;
  min-width: 0;
}

.wizard-step-num {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
  font-weight: 800;
  background: var(--white);
  border: 2px solid var(--border);
  color: var(--text-muted);
  transition: background 0.3s ease, border-color 0.3s ease,
              color 0.3s ease, transform 0.3s ease;
}

.wizard-step-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  line-height: 1.35;
  transition: color 0.3s ease;
}

/* Not yet reached: dimmed, so the numbering still reads as three stages
   without inviting a click that would be refused. */
.wizard-step.is-todo .wizard-step-num {
  background: var(--bg-section);
  border-color: var(--border);
  color: var(--text-light);
}

.wizard-step.is-todo .wizard-step-label {
  color: var(--text-light);
  font-weight: 500;
}

/* Completed step: filled disc with a tick. */
.wizard-step.is-done .wizard-step-num {
  background: var(--brand-accent);
  border-color: var(--brand-accent);
  color: #fff;
}

/* Current step: the disc lifts and pulses once on arrival, so the eye is
   pulled to where the form actually is. */
.wizard-step.is-current .wizard-step-num {
  background: var(--brand-primary);
  border-color: var(--brand-primary);
  color: #fff;
  transform: scale(1.14);
  box-shadow: 0 0 0 5px rgba(11, 61, 145, 0.14);
  animation: wizard-pulse 1.9s ease-out infinite;
}

.wizard-step.is-current .wizard-step-label {
  color: var(--text-dark);
  font-weight: 700;
}

.wizard-step-check {
  animation: wizard-tick 0.32s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wizard-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(11, 61, 145, 0.28); }
  70%  { box-shadow: 0 0 0 9px rgba(11, 61, 145, 0); }
  100% { box-shadow: 0 0 0 5px rgba(11, 61, 145, 0.14); }
}

@keyframes wizard-tick {
  from { opacity: 0; transform: scale(0.4); }
  to   { opacity: 1; transform: scale(1); }
}

/* Thin bar plus an explicit "Step 1 of 3", because a row of numbers alone
   does not tell a screen reader how far along the visitor is. */
.wizard-progress {
  height: 6px;
  border-radius: 999px;
  background: var(--border);
  overflow: hidden;
  margin-top: 22px;
}

.wizard-progress-fill {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--brand-primary) 0%, var(--brand-accent) 100%);
  transition: width 0.55s cubic-bezier(0.22, 1, 0.36, 1);
}

.wizard-count {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-muted);
  margin: 9px 0 0;
  text-align: right;
}

.wizard-count strong {
  color: var(--text-dark);
}

/* Each step fades itself in, so moving between stages feels like turning a
   page rather than the whole card blinking. */
.wizard-pane {
  animation: wizard-pane-in 0.4s cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes wizard-pane-in {
  from { opacity: 0; transform: translateY(9px); }
  to   { opacity: 1; transform: translateY(0); }
}

.wizard-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 4px;
}

.wizard-nav .wizard-next {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 50px;
  font-size: 15px;
  font-weight: 700;
}

.wizard-nav .wizard-back {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 50px;
  padding: 0 18px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--text-muted);
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.18s ease, color 0.18s ease, background 0.18s ease;
}

.wizard-nav .wizard-back:hover {
  border-color: var(--brand-primary);
  color: var(--brand-primary);
  background: var(--white);
}

/* Honour a stated preference for less motion: keep every state change, drop
   the movement. */
@media (prefers-reduced-motion: reduce) {
  .wizard-step.is-current .wizard-step-num,
  .wizard-pane,
  .wizard-step-check {
    animation: none;
  }
  .wizard-progress-fill,
  .wizard-steps::after {
    transition: none;
  }
}

/* ---- Responsive ---- */

@media (max-width: 900px) {
  .auth-shell {
    grid-template-columns: 1fr;
  }

  .auth-brand {
    padding: 40px 28px;
  }

  .auth-brand-title {
    font-size: 1.6rem;
  }

  .auth-brand-text,
  .auth-points {
    display: none;
  }

  .auth-logo {
    margin-bottom: 24px;
  }

  .auth-main {
    padding: 40px 24px 60px;
  }
}

@media (max-width: 560px) {
  .auth-card .form-row { grid-template-columns: 1fr; }

  .auth-block-body { padding: 18px 16px 4px; }
  .auth-block-head { padding: 13px 16px; }

  .auth-title { font-size: 1.6rem; }

  .wizard-step-num {
    width: 28px;
    height: 28px;
    font-size: 12.5px;
  }

  .wizard-steps::before,
  .wizard-steps::after {
    top: 13px;
  }

  .wizard-step-label {
    font-size: 11px;
  }

  .wizard-nav {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .wizard-nav .wizard-back {
    justify-content: center;
  }

  .wizard-count { text-align: left; }
}

/* ============================================
   COMPANY LOGO UPLOAD
   Tokens come from home.css, which base_public.html
   loads ahead of this file.
   ============================================ */

.logo-upload-row {
  display: flex;
  align-items: flex-start;
  gap: 14px;
}

.logo-preview {
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  display: grid;
  place-items: center;
  border-radius: 12px;
  border: 1px dashed var(--border);
  background: var(--bg-light);
  color: var(--text-muted);
}

.logo-upload-fields {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.form-file {
  padding: 7px 10px;
  font-family: var(--font-ui);
  font-size: 13.5px;
}

.form-file::file-selector-button {
  font-family: var(--font-ui);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  background: var(--bg-light);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 6px 12px;
  margin-right: 10px;
  cursor: pointer;
}

.form-file::file-selector-button:hover {
  background: var(--white);
  border-color: var(--brand-accent);
}

.logo-staged {
  font-size: 12.5px;
  color: var(--brand-accent);
  font-weight: 500;
}

.logo-staged strong {
  font-weight: 700;
}

/* Matches the error colour already used for form groups on this page; there is
   no --danger token on the auth sheets. */
.logo-upload.has-error .form-file {
  border-color: #b91c1c;
}
