/* ============================================================
   Tellent sign-in — local replica refinements
   Loaded after auth.css, so it only adds to the original design:
   a real mobile app bar, focus states, and small polish.
   ============================================================ */

:root {
  --t-brand: #5a1cb7;
  --t-brand-strong: #481692;
  --t-ink: #141217;
  --t-body: #5d566c;
  --t-muted: #7e788b;
  --t-line: #dcd8e4;
  --t-soft: #ece8f3;
  --t-danger: #d10015;
  --t-focus: 0 0 0 3px rgba(115, 38, 248, 0.28);
  --t-appbar: 56px;
}

html,
body {
  height: auto;
}

body {
  min-height: 100vh;
  -webkit-text-size-adjust: 100%;
}

::selection {
  background: rgba(90, 28, 183, 0.16);
}

a,
button,
input,
select,
label {
  -webkit-tap-highlight-color: transparent;
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* keyboard focus only, so pointer users keep the original look */
a:focus-visible,
button:focus-visible,
.visibility-icon:focus-visible,
.language-dropdown-button:focus-visible {
  outline: none;
  box-shadow: var(--t-focus);
  border-radius: 8px;
}

.input:focus-visible,
.password-input:focus-visible {
  box-shadow: var(--t-focus);
  border-color: var(--t-brand);
  outline: none;
}

/* the page fills the screen at every size */
.page-container {
  height: auto;
  min-height: 100vh;
}

.page-container .left-panel {
  min-height: 100vh;
  justify-content: flex-start;
}

/* ------------------------------------------------ mobile app bar */
.m-appbar {
  display: none;
}

@media screen and (max-width: 979px) {
  .m-appbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    box-sizing: border-box;
    width: 100%;
    height: var(--t-appbar);
    padding: 0 20px;
    padding-right: max(20px, env(safe-area-inset-right));
    padding-left: max(20px, env(safe-area-inset-left));
    background: rgba(255, 255, 255, 0.92);
    backdrop-filter: saturate(180%) blur(12px);
    -webkit-backdrop-filter: saturate(180%) blur(12px);
    border-bottom: 1px solid #ece9f2;
  }

  .m-appbar__brand {
    display: inline-flex;
    align-items: center;
    height: 22px;
  }

  .m-appbar__brand img {
    height: 22px;
    width: auto;
    display: block;
  }

  .m-appbar__actions {
    display: flex;
    align-items: center;
    gap: 10px;
  }

  .m-appbar__select {
    position: relative;
    display: inline-flex;
    align-items: center;
    height: 32px;
    border-radius: 8px;
  }

  .m-appbar__select select {
    appearance: none;
    -webkit-appearance: none;
    height: 32px;
    padding: 0 24px 0 10px;
    border: 1px solid var(--t-line);
    border-radius: 8px;
    background: #fff;
    color: var(--t-ink);
    font: inherit;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    cursor: pointer;
  }

  .m-appbar__select svg {
    position: absolute;
    right: 5px;
    color: var(--t-body);
    pointer-events: none;
  }

  .m-appbar__cta {
    display: inline-flex;
    align-items: center;
    height: 32px;
    padding: 0 12px;
    border-radius: 8px;
    background: var(--t-brand);
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
  }

  .m-appbar__cta:hover {
    background: var(--t-brand-strong);
    color: #fff;
  }

  /* the app bar replaces the in-page header: same brand, same height,
     and the page then opens straight on the heading */
  .header-container {
    display: none;
  }

  .page-container,
  .page-container .left-panel {
    min-height: calc(100vh - var(--t-appbar));
  }

  .page-container .left-panel {
    padding: 24px 20px calc(24px + env(safe-area-inset-bottom));
  }

  .page-container .left-panel .form-container,
  .page-container .left-panel .content-container {
    max-width: 440px;
  }

  /* keep the legal / language block anchored to the bottom of the screen
     instead of floating right after the last button */
  .auth-footer-container {
    margin-top: auto;
  }
}

@media screen and (max-width: 575px) {
  .page-container .left-panel {
    padding: 28px 18px calc(28px + env(safe-area-inset-bottom));
  }

  .heading-large-x {
    font-size: 22px;
  }

  .primary-button {
    height: 48px;
  }

  .alternative-login-button {
    height: 44px;
  }

  .sign-in-page .login-buttons-container .login-buttons-wrapper {
    gap: 10px;
  }

  .auth-footer-container .footer-language-picker-container {
    margin-bottom: max(24px, env(safe-area-inset-bottom));
  }
}

/* ------------------------------------------------ preview toast */
.preview-toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 90;
  transform: translate(-50%, 12px);
  max-width: min(92vw, 420px);
  padding: 10px 16px;
  border-radius: 10px;
  background: #141217;
  color: #fff;
  font-size: 13px;
  line-height: 20px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(20, 18, 23, 0.24);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
}

.preview-toast.is-visible {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}

/* ------------------------------------------------ PHP version additions */

/* keyboard users land here first; invisible until focused */
.skip-link {
  position: absolute;
  left: 12px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 8px;
  background: var(--t-brand);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
  transition: top 0.15s ease;
}

.skip-link:focus {
  top: 12px;
  color: #fff;
}

/* server-side validation uses the same red the original design uses */
.form-field input.has-error {
  border: 1px solid var(--t-danger);
}

.form-field input.has-error:focus {
  border-color: var(--t-danger);
  box-shadow: 0 0 0 3px rgba(209, 0, 21, 0.16);
}

.alert .content .alert-message-container p {
  margin: 0;
}

.alert {
  margin-bottom: 20px;
}

/* placeholder screens for links the replica does not rebuild */
.stub-copy {
  margin-bottom: 20px;
  color: var(--t-body);
  font-size: 14px;
  line-height: 24px;
}

.stub-copy + p {
  margin: 0;
}

.stub-copy code,
.form-heading-container code {
  padding: 1px 6px;
  border-radius: 6px;
  background: var(--t-soft);
  color: var(--t-ink);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

/* ------------------------------------------------ text buttons */

/* a submit button that reads as a link */
.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: var(--t-brand);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 22px;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.link-button:hover:not(:disabled) {
  color: var(--t-brand-strong);
}

.link-button:disabled {
  color: var(--t-muted);
  text-decoration: none;
  cursor: default;
}

.link-button:focus-visible {
  outline: none;
  box-shadow: var(--t-focus);
  border-radius: 6px;
}

/* ------------------------------------------------ signed-in screen */

/* the small fact list on the signed-in screen */
.session-facts {
  margin: 0 0 20px;
  padding: 0;
  border: 1px solid var(--t-soft);
  border-radius: 10px;
  overflow: hidden;
}

.session-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--t-soft);
}

.session-facts > div:last-child {
  border-bottom: 0;
}

.session-facts dt {
  color: var(--t-muted);
  font-size: 13px;
  line-height: 20px;
}

.session-facts dd {
  margin: 0;
  color: var(--t-ink);
  font-size: 14px;
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

/* ------------------------------------------------ two-factor step */

/* heading + lead + the inline re-send action, spaced like the reference */
.page-container .left-panel .form-container .form-heading-container.code-heading-block {
  margin-bottom: 22px;
}

.code-lead {
  display: block;
  margin-top: 2px;
  color: var(--t-body);
  font-size: 14px;
  line-height: 22px;
}

/* the re-send control is a submit button that reads as a link inside the line */
.code-resend-form {
  display: inline;
  margin: 0;
}

.link-button.code-resend {
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  color: #7b49c5;
  text-decoration: none;
  vertical-align: baseline;
}

.link-button.code-resend:hover:not(:disabled) {
  color: #5a1cb7;
  text-decoration: underline;
}

.link-button.code-resend:disabled {
  color: var(--t-muted);
  text-decoration: none;
}

/* six 48px boxes spread across the 400px column: (400 - 6 * 48) / 5 = 22.4px */
.code-field {
  margin-bottom: 16px;
}

.code-inputs {
  display: flex;
  justify-content: space-between;
}

.form-field .code-input {
  flex: 0 0 48px;
  width: 48px;
  min-width: 0;
  height: 48px;
  padding: 0;
  border-radius: 8px;
  text-align: center;
  font-size: 24px;
  font-weight: 700;
  line-height: 32px;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  color: var(--t-ink);
}

.form-field .code-input.is-filled {
  border-color: var(--t-brand);
}

.form-field .code-input.has-error {
  border: 1px solid var(--t-danger);
}

.code-error {
  margin-top: 10px;
}

/* "Need help? Recover access or learn more about it." */
.auth-footer-container .code-footer-line {
  font-size: 13px;
  line-height: 24px;
  color: var(--t-body);
}

.auth-footer-container .code-footer-line a,
.auth-footer-container .code-footer-line a:visited {
  color: #7b49c5;
  text-decoration: none;
}

.auth-footer-container .code-footer-line a:hover {
  color: #5a1cb7;
  text-decoration: underline;
}

.auth-footer-container .code-footer-line a:focus-visible {
  outline: none;
  border-radius: 4px;
  box-shadow: var(--t-focus);
}

@media screen and (max-width: 575px) {
  .code-inputs {
    gap: 8px;
  }

  /* width:0 (not auto) so the inputs keep a zero intrinsic contribution and the
     six boxes share the row instead of forcing a 480px-wide page on phones */
  .form-field .code-input {
    flex: 1 1 0;
    width: 0;
    height: 48px;
    font-size: 22px;
  }
}
