/*
 * T-135: the sign-in family (sign in, studio sign in, forgot password, set a
 * new password, sign up, confirm it's you) drawn like the class schedule.
 *
 * A deep-teal band across the top replaces the background photo; the white
 * card overlaps it; the page under it is the calendar's light grey. Loaded
 * AFTER style.bundle.css and custom.css so these rules win at equal
 * specificity. Wording, fields and scripts are unchanged: this file only
 * decides how they look.
 */
body.auth-page {
  --auth-teal: #125c65;
  --auth-teal-dark: #0f4f57;
  --auth-deep: #0b3f46;
  --auth-mist: #e4f0f0;
  --auth-page: #F6F6F6;
  --auth-line: #ebebeb;
  --auth-ink: #181c32;
  --auth-sub: #7e8299;
  --auth-input: #e1e3ea;
  --auth-soft: #f9f9f9;
  --auth-err: #c0392b;

  background: var(--auth-page) !important;
  background-image: none !important;
  font-family: 'DM Sans', 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
  color: var(--auth-ink);
  min-height: 100vh;
}

body.auth-page #kt_app_root {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

/* ---------- the band ---------- */
.auth-band {
  background: var(--auth-deep);
  padding: 34px 20px 78px;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 132px;
}

/* The studio lockup becomes the small white tile on the band. */
.auth-band .brand-lockup {
  max-width: 300px;
  padding: 14px 22px !important;
  border-radius: 12px !important;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .15) !important;
}

.auth-band .brand-lockup-logo {
  height: 64px;
  width: 64px;
  margin-bottom: 8px !important;
}

.auth-band .brand-lockup-name {
  font-size: 20px;
}

.auth-band .brand-lockup-poweredby {
  margin-top: 4px !important;
  font-size: 12px;
}

/* ---------- the card ---------- */
.auth-main {
  flex: 1 0 auto;
  padding: 0 16px;
}

.auth-card {
  max-width: 440px;
  margin: -56px auto 0;
  background: #fff;
  border: 1px solid var(--auth-line);
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(17, 17, 17, .06);
  padding: 26px 24px;
  display: grid;
  gap: 14px;
}

.auth-card-wide {
  max-width: 480px;
}

/* The Corebility wordmark is dark on transparent, so on the unbranded pages it
   sits at the top of the white card and the band stays empty (mockup note). */
.auth-logo {
  text-align: center;
}

.auth-logo .logo-text {
  font-size: 0 !important;
}

.auth-logo .logo-text img {
  max-width: 150px;
  height: auto;
}

.auth-title {
  font-size: 22px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -.01em;
  color: var(--auth-ink);
  margin: 0;
}

.auth-intro {
  color: var(--auth-sub);
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
}

.auth-signed-in {
  font-size: 14px;
  font-weight: 600;
  margin: 0;
}

.auth-card form {
  display: grid;
  gap: 12px;
  width: 100%;
}

.auth-card .fv-row {
  margin: 0 !important;
}

.auth-card .companyListing:empty,
.auth-card .flashMessage:empty {
  display: none;
}

.auth-card .form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--auth-ink);
  margin-bottom: 6px;
}

.auth-card .form-control,
.auth-card .form-select {
  height: 42px;
  border: 1px solid var(--auth-input);
  border-radius: 7.6px;
  background-color: #fff !important;
  color: var(--auth-ink);
  font-size: 14px;
  padding: 0 12px;
  box-shadow: none;
}

.auth-card .form-control:focus,
.auth-card .form-select:focus {
  border-color: var(--auth-teal);
  box-shadow: 0 0 0 3px rgba(18, 92, 101, .12);
}

.auth-card .form-control[readonly] {
  background-color: var(--auth-soft) !important;
}

.auth-card .form-control::placeholder {
  color: #a1a5b7;
}

/* The show/hide eye (password-reveal.js). custom.css lays the wrapper out as
   a one-cell grid so the button sits inside the field, centred on it; this
   file used to set it to `block`, which dropped the eye onto its own line
   under the field. Only the input's right padding needs restating here,
   because `.auth-card .form-control` above outranks custom.css's. */
.auth-card .pw-reveal > input {
  padding-right: 42px;
}

/* ---------- buttons ---------- */
.auth-card .btn {
  min-height: 42px;
  border-radius: 7.6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  padding: 8px 16px;
}

.auth-card .btn.btn-primary {
  background: var(--auth-teal) !important;
  border: 1px solid var(--auth-teal) !important;
  color: #fff !important;
}

.auth-card .btn.btn-primary:hover,
.auth-card .btn.btn-primary:focus {
  background: var(--auth-teal-dark) !important;
  border-color: var(--auth-teal-dark) !important;
}

.auth-card .btn.auth-btn-secondary {
  background: var(--auth-soft) !important;
  color: var(--auth-sub) !important;
  border: 1px solid var(--auth-line) !important;
}

.auth-card .btn.auth-btn-secondary:hover {
  color: var(--auth-ink) !important;
}

/* Forgot password: the two buttons stacked, full width. */
.auth-stack {
  display: grid;
  gap: 8px;
}

/* Confirm it's you: Cancel on the left, the wider Confirm on the right. The
   submit button stays first in the markup, so Enter and the tab order are as
   they were; only the order on screen changes. */
.auth-actions {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 8px;
}

.auth-actions .btn-primary {
  order: 2;
}

.auth-actions .auth-btn-secondary {
  order: 1;
}

/* ---------- links, separator, alerts ---------- */
.auth-card a:not(.btn),
.auth-foot a {
  color: var(--auth-teal);
  font-weight: 600;
}

.auth-card a:not(.btn):hover,
.auth-foot a:hover {
  color: var(--auth-teal-dark);
  text-decoration: underline;
}

.auth-forgot {
  text-align: right;
  font-size: 14px;
}

.auth-sep {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--auth-sub);
  font-size: 12px;
}

.auth-sep::before,
.auth-sep::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--auth-line);
}

.auth-muted {
  color: var(--auth-sub);
  font-size: 13px;
  line-height: 1.5;
  margin: 0;
}

.auth-card .alert {
  border: 0;
  border-radius: 7.6px;
  padding: 10px 12px;
  font-size: 13.5px;
  font-weight: 500;
  margin: 0;
}

.auth-card .alert-danger {
  background: #fdecea;
  color: var(--auth-err);
}

.auth-card .alert-success {
  background: var(--auth-mist);
  color: var(--auth-deep);
}

.auth-card .alert-warning {
  background: #fff8dd;
  color: #7a5a00;
}

.auth-card small.text-danger,
.auth-card label.error,
.auth-card .invalid-feedback {
  color: var(--auth-err) !important;
  font-size: 12.5px;
}

/* A field's error sits inside the field's own box: the input and the message
   share one red outline, the message a tinted strip along its bottom. The
   message is jQuery-validate's label.error (put straight after the input,
   inside .pw-reveal for a password) or the server's small.text-danger (after
   the input, or after the .pw-reveal wrapper). Browsers without :has() keep
   the plain red line under the field. */
.auth-card .fv-row:has(> input + label.error:not([style*="none"])) > input,
.auth-card .fv-row:has(> input + small.text-danger) > input,
.auth-card .pw-reveal:has(> input + label.error:not([style*="none"])) > input,
.auth-card .fv-row:has(> .pw-reveal + small.text-danger) .pw-reveal > input {
  border-color: var(--auth-err) !important;
  box-shadow: none !important;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.auth-card .fv-row > input + label.error,
.auth-card .fv-row > input + small.text-danger,
.auth-card .pw-reveal > input + label.error,
.auth-card .fv-row > .pw-reveal + small.text-danger {
  display: block;
  margin: -1px 0 0;
  padding: 6px 12px 7px;
  border: 1px solid var(--auth-err);
  border-top: 0;
  border-radius: 0 0 7.6px 7.6px;
  background: #fdf1f0;
  font-weight: 600;
  line-height: 1.35;
}

/* The eye stays centred on the input, not on input plus message. */
.auth-card .pw-reveal > input + label.error { grid-row: 2; }
.auth-card .pw-reveal > .pw-reveal-btn { grid-row: 1; }

/* Sign up's privacy tick: the box takes the teal; the words are unchanged. */
.auth-card .form-check-input {
  width: 18px;
  height: 18px;
  border-radius: 5px;
}

.auth-card .form-check-input:checked {
  background-color: var(--auth-teal);
  border-color: var(--auth-teal) !important;
}

.auth-card .form-check-label {
  color: var(--auth-ink);
  font-size: 14px;
}

/* ---------- the foot ---------- */
.auth-foot {
  text-align: center;
  padding: 18px 16px 28px;
  font-size: 13px;
  color: var(--auth-sub);
}

@media (min-width: 768px) {
  .auth-band {
    padding-top: 44px;
  }

  .auth-card {
    padding: 32px 32px;
  }
}

/* ---------- two-factor: the code prompt and the setup steps ---------- */
/* auth/two_factor_challenge.php and auth/two_factor_setup.php (W4-12). */
.tf-head {
  display: grid;
  gap: 8px;
}

.tf-center {
  text-align: center;
}

.tf-head.tf-center .auth-intro {
  max-width: 340px;
  margin: 0 auto;
}

/* The code box: one large, spaced, centred field, the way a phone shows it. */
.auth-card .tf-code {
  height: 60px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 26px;
  font-weight: 600;
  letter-spacing: .3em;
  text-indent: .3em;
  text-align: center;
  font-variant-numeric: tabular-nums;
  border-radius: 10px;
  border-width: 1.5px;
}

.auth-card .tf-code::placeholder {
  color: #d5d8e1;
  opacity: 1;
}

.auth-card .tf-code-inline {
  max-width: 260px;
}

.tf-hint {
  color: var(--auth-sub);
  font-size: 13px;
  line-height: 1.45;
  margin: 8px 0 0;
}

/* Trust this computer: a plain tick row, the hint under the words. */
.tf-check {
  gap: 10px;
  padding: 0;
  margin: 2px 0 0;
}

.tf-check .form-check-input {
  flex: 0 0 auto;
  margin-top: 1px;
}

.tf-check-title {
  display: block;
  font-weight: 600;
  font-size: 14px;
}

.tf-check .tf-hint {
  margin-top: 1px;
}

/* The second way in (email me a code): a teal text button, clearly live. */
.auth-card .btn.tf-link-btn {
  background: transparent !important;
  border: 0 !important;
  color: var(--auth-teal) !important;
  font-weight: 600;
  min-height: 40px;
}

.auth-card .btn.tf-link-btn:hover,
.auth-card .btn.tf-link-btn:focus-visible {
  background: var(--auth-mist) !important;
  color: var(--auth-deep) !important;
}

.tf-foot {
  text-align: center;
  font-size: 13.5px;
  padding-top: 16px;
  border-top: 1px solid var(--auth-line);
}

.tf-foot a:not(.btn) {
  color: var(--auth-sub) !important;
  font-weight: 500;
}

.tf-foot a:not(.btn):hover {
  color: var(--auth-ink) !important;
}

/* "Your account needs this extra step": one quiet amber line, not a banner. */
.tf-required {
  display: inline-flex;
  align-self: start;
  width: fit-content;
  padding: 5px 10px;
  border-radius: 8px;
  background: #fff4d6;
  color: #7a5a00;
  font-size: 12.5px;
  font-weight: 600;
}

/* The setup steps: a numbered rail down the left, one step per item. */
.tf-steps {
  list-style: none;
  counter-reset: tf-step;
  margin: 6px 0 0;
  padding: 0;
  display: grid;
}

.tf-step {
  counter-increment: tf-step;
  position: relative;
  padding: 0 0 24px 42px;
}

.tf-step::before {
  content: counter(tf-step);
  position: absolute;
  left: 0;
  top: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--auth-mist);
  color: var(--auth-teal);
  font-weight: 700;
  font-size: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tf-step:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 12.5px;
  top: 32px;
  bottom: 6px;
  width: 1px;
  background: var(--auth-line);
}

.tf-step:last-child {
  padding-bottom: 2px;
}

.tf-step-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--auth-ink);
  margin: 3px 0 4px;
}

.tf-step-body,
.tf-step .form-label {
  font-size: 14px;
  line-height: 1.5;
  color: #4b5065;
  font-weight: 400;
  margin: 0 0 0;
}

.tf-step .form-label {
  margin-bottom: 10px;
}

/* Scan: the QR and, beside it, the key for typing in by hand. */
.tf-scan {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  margin-top: 12px;
  padding: 12px;
  border-radius: 10px;
  background: var(--auth-soft);
  border: 1px solid var(--auth-line);
}

.tf-qr {
  padding: 8px;
  border-radius: 8px;
  background: #fff;
  border: 1px solid var(--auth-line);
  line-height: 0;
}

.tf-qr img {
  display: block;
  width: 128px;
  height: 128px;
}

.tf-manual .tf-hint {
  margin: 0 0 8px;
}

.tf-key {
  display: grid;
  gap: 8px;
  justify-items: start;
}

.tf-key code {
  justify-self: stretch;
}

.tf-key code {
  display: block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .02em;
  line-height: 1.6;
  color: var(--auth-ink);
  background: #fff;
  border: 1px solid var(--auth-input);
  border-radius: 7.6px;
  padding: 7px 10px;
  word-break: normal;
  overflow-wrap: break-word;
}

.auth-card .btn.tf-copy {
  min-height: 32px;
  padding: 4px 12px;
  font-size: 13px;
  font-weight: 600;
  background: #fff !important;
  color: var(--auth-teal) !important;
  border: 1px solid #c9dfe1 !important;
}

.auth-card .btn.tf-copy:hover {
  background: var(--auth-mist) !important;
}

.auth-card .btn.tf-inline-btn {
  margin-top: 6px;
  padding-left: 0;
  padding-right: 0;
}

.tf-status {
  color: var(--auth-teal);
  font-size: 13px;
  font-weight: 600;
}

.tf-status:not(:empty) {
  margin-top: 6px;
}

.tf-confirm-first {
  margin-top: 16px !important;
}

@media (max-width: 480px) {
  .tf-scan {
    grid-template-columns: minmax(0, 1fr);
    justify-items: center;
    text-align: center;
  }
  .tf-key {
    justify-items: center;
  }
  .tf-qr img {
    width: 176px;
    height: 176px;
  }
  .auth-card .tf-code-inline {
    max-width: none;
  }
}
