/* Backoffice auth screens (login, 2FA) — matches the theme in docs/img.png */

.login {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
  min-height: 100vh;
}

.logo--light { color: #fff; }
.logo--light .logo__mark { background: #fff; }
.logo--light .logo__text b { color: #9fe3dc; }

.logo--mobile { display: none; margin-bottom: 32px; }

/* ---------- Left brand area ---------- */

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 40px 56px;
  overflow: hidden;
  color: #fff;
  background:
    radial-gradient(circle at 85% 15%, rgba(159, 227, 220, .22), transparent 45%),
    radial-gradient(circle at 10% 90%, rgba(255, 255, 255, .08), transparent 40%),
    linear-gradient(150deg, #0f7c80 0%, #0b5c63 55%, #084a51 100%);
}

/* Subtle grid texture */
.brand::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image:
    linear-gradient(rgba(255, 255, 255, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(180deg, transparent, #000 30%, #000 70%, transparent);
  pointer-events: none;
}

.brand > * { position: relative; }

.brand__content { max-width: 520px; }

.tag {
  display: inline-block;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  border: 1px solid rgba(255, 255, 255, .18);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}

.brand h2 {
  margin: 20px 0 16px;
  font-size: clamp(32px, 3.4vw, 44px);
  line-height: 1.12;
  font-weight: 700;
  letter-spacing: -.025em;
}

.brand h2 span { color: #9fe3dc; }

.brand p {
  font-size: 16px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .78);
}

.brand__footer { font-size: 13px; color: rgba(255, 255, 255, .6); }

/* Stat cards echoing the dashboard theme */
.preview {
  position: relative;
  height: 210px;
  margin-top: 44px;
}

.preview__card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 14px;
  width: 250px;
  padding: 16px 18px;
  border-radius: 14px;
  background: #fff;
  color: var(--text);
  box-shadow: 0 18px 40px rgba(3, 30, 33, .28);
}

.preview__card small { display: block; font-size: 13px; color: var(--text-secondary); }
.preview__card strong { display: block; margin-top: 2px; font-size: 24px; font-weight: 700; }

.preview__card--1 { top: 0; left: 0; }
.preview__card--2 { top: 72px; left: 190px; }
.preview__card--3 { top: 144px; left: 40px; }

.icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 12px;
}

.icon svg { width: 22px; height: 22px; }
.icon--red { background: #fdeceb; color: #e04a4f; }
.icon--teal { background: var(--primary-light); color: var(--primary); }
.icon--blue { background: #e8f0fd; color: #2f6fd6; }

/* ---------- Right form area ---------- */

.form-area {
  display: grid;
  grid-template-columns: minmax(0, 420px);
  place-content: center;
  padding: 40px 24px;
}

.form-box {
  width: 100%;
  max-width: 420px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 600;
}

.badge svg { width: 16px; height: 16px; }

.form-box h1 {
  margin: 18px 0 8px;
  font-size: 30px;
  font-weight: 700;
  letter-spacing: -.02em;
}

.subtitle {
  margin-bottom: 28px;
  font-size: 15px;
  color: var(--text-secondary);
}

.alert {
  display: flex;
  gap: 10px;
  margin-bottom: 20px;
  padding: 12px 14px;
  border: 1px solid #f6c9cd;
  border-radius: var(--radius);
  background: var(--danger-light);
  color: #a8232d;
  font-size: 14px;
  line-height: 1.45;
}

.field { margin-bottom: 18px; }

.field label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 600;
}

.input {
  position: relative;
  display: flex;
  align-items: center;
}

.input > svg {
  position: absolute;
  left: 14px;
  color: var(--text-muted);
  pointer-events: none;
  transition: color .15s;
}

.input input {
  width: 100%;
  height: 50px;
  padding: 0 46px 0 44px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: 15px;
  color: var(--text);
  transition: border-color .15s, box-shadow .15s;
}

.input input::placeholder { color: #a9b0bc; }
.input input:hover { border-color: #cdd3db; }

.input input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(15, 124, 128, .14);
}

.input:focus-within > svg { color: var(--primary); }

.field--error .input input { border-color: var(--danger); }
.field--error .input input:focus { box-shadow: 0 0 0 4px rgba(217, 58, 69, .14); }

.field__error,
.caps-warning {
  display: block;
  margin-top: 6px;
  font-size: 13px;
  color: var(--danger);
}

.caps-warning { color: #b7791f; }
.caps-warning[hidden] { display: none; }

.password-toggle {
  position: absolute;
  right: 6px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--text-muted);
  cursor: pointer;
}

.password-toggle:hover { background: var(--bg); color: var(--text); }
.password-toggle:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.password-toggle .eye-closed,
.password-toggle.is-visible .eye-open { display: none; }
.password-toggle.is-visible .eye-closed { display: block; }

/* Remember me */
.checkbox {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 4px 0 24px;
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  user-select: none;
}

.checkbox input { position: absolute; opacity: 0; pointer-events: none; }

.checkbox__box {
  display: grid;
  place-items: center;
  width: 20px;
  height: 20px;
  border: 1.5px solid #c5ccd5;
  border-radius: 6px;
  background: #fff;
  transition: background .15s, border-color .15s;
}

.checkbox input:checked + .checkbox__box {
  border-color: var(--primary);
  background: var(--primary) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12l5 5 9-10'/%3E%3C/svg%3E") center / 13px no-repeat;
}

.checkbox input:focus-visible + .checkbox__box { box-shadow: 0 0 0 4px rgba(15, 124, 128, .18); }

/* Submit button */
.button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 50px;
  border: 0;
  border-radius: var(--radius);
  background: var(--primary-dark);
  color: #fff;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(11, 92, 99, .25);
  transition: background .15s, transform .15s, box-shadow .15s;
}

.button svg { transition: transform .15s; }
.button:hover { background: var(--primary); box-shadow: 0 8px 22px rgba(11, 92, 99, .3); }
.button:hover svg { transform: translateX(3px); }
.button:active { transform: translateY(1px); }
.button:focus-visible { outline: 3px solid rgba(15, 124, 128, .35); outline-offset: 2px; }

.help {
  margin-top: 20px;
  font-size: 14px;
  text-align: center;
  color: var(--text-secondary);
}

.help strong { color: var(--primary); font-weight: 600; }

.security {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 36px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}

.security svg { width: 15px; height: 15px; }

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

@media (max-width: 1100px) {
  .brand { padding: 36px 40px; }
  .preview__card--2 { left: 150px; }
}

@media (max-width: 900px) {
  .login { grid-template-columns: minmax(0, 1fr); }
  .brand { display: none; }
  .logo--mobile { display: flex; width: fit-content; }
  .form-area { align-items: start; padding: 48px 16px; }
}

/* ---------- Messages, links, 2FA ---------- */

.alert--success { border-color: #bfe6cf; background: var(--success-light); color: #17733f; }

.help a,
.security a { color: var(--primary); font-weight: 600; text-decoration: none; }
.help a:hover,
.security a:hover { text-decoration: underline; }

.input--code input {
  padding: 0 16px;
  font-size: 22px;
  font-weight: 600;
  letter-spacing: .35em;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.input--code input::placeholder { letter-spacing: .35em; }

.setup-steps {
  display: grid;
  gap: 20px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.setup-steps li { display: flex; gap: 14px; }
.setup-steps li > div { flex: 1; min-width: 0; }
.setup-steps strong { display: block; margin: 3px 0 4px; font-size: 15px; }
.setup-steps p { font-size: 13.5px; line-height: 1.5; color: var(--text-secondary); }
.setup-steps form { margin-top: 12px; }
.setup-steps .field { margin-bottom: 12px; }

.setup-steps__num {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary-dark);
  font-size: 13px;
  font-weight: 700;
}

.qr-box {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 10px;
  padding: 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.qr-box__code { flex-shrink: 0; width: 140px; height: 140px; image-rendering: pixelated; }
.qr-box__secret small { display: block; margin-bottom: 6px; font-size: 12.5px; color: var(--text-muted); }

.qr-box__secret code {
  display: block;
  font: 600 13px/1.6 ui-monospace, SFMono-Regular, Menlo, monospace;
  letter-spacing: .04em;
  word-break: break-word;
  color: var(--text);
}

@media (max-width: 480px) {
  .qr-box { flex-direction: column; align-items: flex-start; }
}

/* Company logo */
.logo__image { display: block; max-width: 200px; max-height: 40px; object-fit: contain; }
.logo__image--brand { max-height: 44px; }

/* Password reset */
a.button { text-decoration: none; }
.field__hint { display: block; margin-top: 6px; color: var(--text-muted, #8a93a3); font-size: 12.5px; line-height: 1.45; }
.alert + .subtitle { margin-top: 14px; }
