/* -------------------------------------------------------------------------
   /client-login: the client portal sign-in page, after
   brandinsightai.com/client-login with Brand Share Of Search branding. Self-contained like
   legal.css: the tokens and the Inter face are mirrored by hand from
   index.html's :root, so a token change there needs the same change here.
   ------------------------------------------------------------------------- */

@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("/fonts/InterVariable-4.1-latin.woff2") format("woff2");
}

:root {
  color-scheme: dark;
  --background: #171717;
  --foreground: #f5f5f5;
  --card: #292929;
  --muted: #383838;
  --muted-foreground: #b3b3b3;
  --border: #474747;
  --input: #383838;
  --control-edge: #7a7a7a;
  --ring: #ee1b24;
  /* #ee1b24 for edges and rings, #d71921 for fills (white text 5.18:1),
     #ff5c62 for small red text (4.82:1 on the card). */
  --brand-red: #ee1b24;
  --brand-red-fill: #d71921;
  --brand-red-dark: #b30000;
  --brand-red-text: #ff5c62;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background-color: var(--background);
  color: var(--foreground);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a {
  color: inherit;
}

img,
svg {
  display: block;
}

:focus-visible {
  outline: none;
  box-shadow: 0 0 0 2px var(--ring);
  border-radius: 6px;
}

/* --- Back link, top left ------------------------------------------------ */

.back-link {
  position: absolute;
  top: 22px;
  left: 28px;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--muted-foreground);
  transition: color 150ms;
}

.back-link:hover {
  color: var(--foreground);
}

.back-link svg {
  width: 16px;
  height: 16px;
}

/* --- Lockup and card ---------------------------------------------------- */

.portal {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 112px 20px 48px;
}

/* The product logo (links home), a tall divider, then the Converged.AI mark,
   as in the landing header. */
.portal-lockup {
  display: inline-flex;
  align-items: center;
  gap: 28px;
  margin-bottom: 32px;
}

.lockup-home {
  display: inline-flex;
  border-radius: 8px;
  text-decoration: none;
}

.portal-lockup .converged-logo {
  height: 30px;
  width: auto;
}


.lockup-divider {
  width: 1px;
  height: 64px;
  background-color: rgba(255, 255, 255, 0.55);
}

.portal-lockup .product-logo {
  height: 78px;
  width: auto;
}

.portal-card {
  width: 100%;
  max-width: 512px;
  padding: 24px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background-color: var(--card);
}

.portal-card h1 {
  font-size: 1.875rem;
  font-weight: 800;
  letter-spacing: -0.025em;
  line-height: 1.2;
  text-align: center;
}

.portal-sub {
  margin-top: 6px;
  margin-bottom: 22px;
  font-size: 0.9375rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* --- Buttons: 6px, red primary, outlined secondary ---------------------- */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  width: 100%;
  height: 48px;
  padding-inline: 20px;
  border: 1px solid transparent;
  border-radius: 6px;
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  cursor: pointer;
  transition: background-color 150ms, border-color 150ms, transform 150ms;
}

.btn:active {
  transform: scale(0.98);
}

.btn:focus-visible {
  border-radius: 6px;
}

.btn[disabled] {
  pointer-events: none;
  opacity: 0.55;
}

.btn-primary {
  background-color: var(--brand-red-fill);
  color: #ffffff;
}

.btn-primary:hover {
  background-color: var(--brand-red-dark);
}

.btn-primary:focus-visible {
  box-shadow:
    0 0 0 2px var(--card),
    0 0 0 4px var(--brand-red);
}

/* The Google mark keeps its own colours on a small white tile, the light
   surface Google's sign-in guidance asks for. */
.btn-google .google-mark {
  width: 24px;
  height: 24px;
  padding: 3px;
  border-radius: 4px;
  background-color: #ffffff;
}

.btn-outline {
  margin-top: 16px;
  border-color: var(--control-edge);
  background-color: var(--background);
  color: var(--foreground);
}

.btn-outline:hover {
  border-color: var(--foreground);
}

.btn-outline svg {
  width: 18px;
  height: 18px;
}

/* --- Helpers, divider, form --------------------------------------------- */

.portal-help {
  margin-top: 10px;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--muted-foreground);
  text-align: center;
}

.portal-help-left {
  text-align: left;
}

.portal-error,
.portal-status[data-tone="error"] {
  color: #f5b5b5;
}

.portal-error {
  margin-top: 10px;
  font-size: 0.875rem;
  text-align: center;
}

/* A hairline either side of a small "or". A separator, not a section
   label. */
.or-divider {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-block: 22px;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted-foreground);
}

.or-divider::before,
.or-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background-color: var(--border);
}

.portal-label {
  display: block;
  font-size: 0.9375rem;
  font-weight: 600;
}

/* Their red left-edge accent on the field. #7a7a7a edges are 3.39:1 on the
   card. */
.portal-input {
  display: block;
  width: 100%;
  height: 44px;
  margin-top: 8px;
  padding-inline: 14px;
  border: 1px solid var(--control-edge);
  border-left: 3px solid var(--brand-red);
  border-radius: 6px;
  background-color: var(--input);
  color: var(--foreground);
  font: inherit;
  font-size: 0.9375rem;
}

.portal-input::placeholder {
  color: var(--muted-foreground);
}

.portal-input:focus-visible {
  border-color: var(--brand-red);
  box-shadow: 0 0 0 1px var(--brand-red);
}

.portal-input[aria-invalid="true"] {
  border-color: #f5b5b5;
  border-left-color: var(--brand-red);
}

.portal-status {
  margin-top: 10px;
  font-size: 0.875rem;
  line-height: 1.45;
}

.portal-status:empty {
  display: none;
}

/* "contact us" inside the sent-link status line. */
.portal-status a {
  color: var(--foreground);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.portal-foot {
  margin-top: 28px;
  font-size: 0.875rem;
  color: var(--muted-foreground);
  text-align: center;
}

/* --- Footer: the legal pages' row --------------------------------------- */

.site-footer {
  border-top: 1px solid var(--border);
  padding: 20px 24px;
}

.footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  max-width: 1072px;
  margin-inline: auto;
  font-size: 0.8125rem;
  color: var(--muted-foreground);
}

.footer-links {
  display: flex;
  gap: 20px;
}

.footer-links a,
.footer-credit {
  color: var(--muted-foreground);
  text-decoration: none;
  transition: color 150ms;
}

.footer-links a:hover,
.footer-credit:hover {
  color: var(--foreground);
  text-decoration: underline;
}

/* "Built by" + the Havas Middle East lockup (inline SVG). */
.footer-credit {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
}

.footer-logo {
  flex: none;
  height: 22px;
  width: auto;
}

/* External links open in a new tab; the arrow says so. */
.footer-credit::after {
  content: "\2197";
  content: "\2197" / " (opens in a new tab)";
  display: inline-block;
  margin-left: 0.15em;
  font-size: 0.85em;
}

/* --- Phones: back link above the lockup, lockup scaled down ------------- */

@media (max-width: 620px) {
  .back-link {
    top: 18px;
    left: 20px;
  }

  .portal {
    padding: 64px 16px 32px;
  }

  /* The lockup stacks: product logo above the Converged.AI mark. */
  .portal-lockup {
    flex-direction: column;
    gap: 12px;
    margin-bottom: 24px;
  }

  .lockup-divider {
    display: none;
  }

  .portal-lockup .converged-logo {
    height: 18px;
  }

  .portal-lockup .product-logo {
    height: 42px;
  }

  .portal-card {
    padding: 20px;
  }
}
