/* Tracking Connector settings. Thriven visual system, light only. */

@font-face {
  font-family: "Instrument Serif";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/settings/assets/fonts/instrument-serif-400.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 1000;
  font-display: swap;
  src: url("/settings/assets/fonts/dm-sans-variable.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Metric-matched fallbacks (from the Thriven site) so the swap does not shift the layout. */
@font-face {
  font-family: "DM Sans Fallback";
  src: local("Arial");
  size-adjust: 104.5%;
  ascent-override: 94.7%;
  descent-override: 29.7%;
  line-gap-override: 0%;
}

@font-face {
  font-family: "Instrument Serif Fallback";
  src: local("Times New Roman");
  size-adjust: 83.6%;
  ascent-override: 118.4%;
  descent-override: 37.1%;
  line-gap-override: 0%;
}

:root {
  color-scheme: light;

  --tc-teal: #002635;
  --tc-teal-light: #114054;
  --tc-green: #00C589;
  --tc-white: #FFFFFF;
  --tc-band: #F6F7F8;
  --tc-ink: #0B121A;
  --tc-muted: #4F565E;
  --tc-rule: #E3E5E7;
  --tc-field-border: #6D7277;
  --tc-danger: #C50514;
  --tc-selection: rgba(0, 197, 137, 0.2);

  --tc-font-serif: "Instrument Serif", "Instrument Serif Fallback", Georgia, "Times New Roman", serif;
  --tc-font-sans: "DM Sans", "DM Sans Fallback", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --tc-font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*,
*::before,
*::after {
  box-sizing: border-box;
  border-radius: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--tc-white);
  color: var(--tc-ink);
  font-family: var(--tc-font-sans);
  font-size: 1rem;
  line-height: 1.6;
  font-feature-settings: "kern" 1, "liga" 1;
  -webkit-font-smoothing: antialiased;
}

::selection {
  background: var(--tc-selection);
  color: var(--tc-ink);
}

h1,
h2,
h3 {
  margin: 0;
  font-family: var(--tc-font-serif);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.01em;
  color: var(--tc-teal);
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 1.6rem + 2.2vw, 3rem);
}

h2 {
  font-size: clamp(1.75rem, 1.4rem + 1.2vw, 2.25rem);
}

h3 {
  font-size: 1.5rem;
  overflow-wrap: anywhere;
}

p {
  margin: 0 0 1rem;
}

a {
  color: var(--tc-teal-light);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
  cursor: pointer;
  transition: color 150ms ease-out;
}

a:hover {
  color: var(--tc-teal);
  text-decoration-thickness: 2px;
}

button,
select,
input[type="submit"] {
  cursor: pointer;
}

/* Layout */

.wrap {
  box-sizing: content-box;
  max-width: 1120px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .wrap {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: 0;
  z-index: 10;
  padding: 0.75rem 1rem;
  background: var(--tc-teal);
  color: var(--tc-white);
  transform: translateY(-120%);
}

.skip-link:hover {
  color: var(--tc-white);
}

.skip-link:focus {
  transform: none;
}

main {
  flex: 1 0 auto;
}

main:focus,
main:focus-visible {
  outline: 2px solid transparent;
}

/* Header band */

.masthead {
  background: var(--tc-white);
  border-bottom: 1px solid var(--tc-rule);
}

.masthead__bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1.5rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

/* The page h1 (PRD-003 AC-UI1): the green mark and "Tracking Connector". */
.wordmark {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin: 0;
  font-family: var(--tc-font-serif);
  font-size: clamp(1.5rem, 1.3rem + 0.8vw, 1.875rem);
  line-height: 1.2;
  color: var(--tc-teal);
}

.wordmark__mark {
  flex: none;
  width: 0.75rem;
  height: 0.75rem;
  background: var(--tc-green);
}

.account {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
}

.account form {
  margin: 0;
}

.account__email {
  color: var(--tc-muted);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0 1.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.tabs a {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding-top: 0.25rem;
  color: var(--tc-muted);
  font-weight: 500;
  text-decoration: none;
  border-bottom: 3px solid transparent;
  transition: color 150ms ease-out, border-color 150ms ease-out;
}

.tabs a:hover {
  color: var(--tc-teal);
  border-bottom-color: var(--tc-rule);
}

.tabs a[aria-current="page"] {
  color: var(--tc-teal);
  font-weight: 700;
  border-bottom-color: var(--tc-green);
}

/* Content bands */

.band {
  padding-top: 2.5rem;
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--tc-rule);
}

.band--white {
  background: var(--tc-white);
}

.band--grey {
  background: var(--tc-band);
}

@media (min-width: 640px) {
  .band {
    padding-top: 3.5rem;
    padding-bottom: 3.5rem;
  }
}

.band h2 {
  margin-bottom: 0.75rem;
}

.lede {
  max-width: 62ch;
  color: var(--tc-muted);
}

.narrow {
  max-width: 38rem;
}

/* Two fields side by side where there is room (the add form). */
.form-grid {
  display: grid;
  gap: 0 2rem;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
  align-items: start;
}

/* Divided lists */

.rows {
  margin: 1.5rem 0 0;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--tc-rule);
}

.row {
  display: grid;
  gap: 1rem 2rem;
  padding-top: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--tc-rule);
}

.row__main {
  min-width: 0;
}

/* Wide rows (the Logins list) put the actions beside the text. */
@media (min-width: 640px) {
  .row--beside {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
  }
}

.status {
  margin: 0.25rem 0 0;
  font-weight: 700;
}

.status--attention {
  color: var(--tc-danger);
}

.facts {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  gap: 0.25rem 1rem;
  margin: 0.75rem 0 0;
  font-size: 0.9375rem;
}

.facts dt {
  color: var(--tc-muted);
}

.facts dd {
  margin: 0;
  overflow-wrap: anywhere;
}

.mono {
  font-family: var(--tc-font-mono);
  font-size: 0.9375rem;
  overflow-wrap: anywhere;
}

.row__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 0.75rem;
}

.row__actions form {
  flex: 1 1 100%;
  margin: 0;
}

.row__actions .button {
  width: 100%;
}

@media (min-width: 640px) {
  .row__actions form {
    flex: 0 1 auto;
  }

  .row__actions .button {
    width: auto;
    height: 100%;
  }

  .row__actions .test-form {
    flex: 1 1 14rem;
    max-width: 20rem;
  }

  .row__actions .test-form .button {
    width: 100%;
  }
}

.limit-note {
  margin: 0;
  padding: 0.5rem 0;
  color: var(--tc-muted);
  font-size: 0.9375rem;
}

/* Notices and messages */

.notice {
  margin: 0 0 1.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--tc-teal);
  border-bottom: 1px solid var(--tc-teal);
  color: var(--tc-teal);
}

.notice--success::before {
  content: "";
  display: inline-block;
  width: 0.5rem;
  height: 0.5rem;
  margin-right: 0.625rem;
  background: var(--tc-green);
}

.notice--error {
  border-top-color: var(--tc-danger);
  border-bottom-color: var(--tc-danger);
  color: var(--tc-danger);
}

.notice a {
  color: inherit;
}

.warning {
  margin: 0 0 1.5rem;
  padding: 0.875rem 0;
  border-top: 1px solid var(--tc-danger);
  border-bottom: 1px solid var(--tc-danger);
  color: var(--tc-danger);
}

.points {
  margin: 0 0 1.5rem;
  padding-left: 1.25rem;
}

.points li {
  margin-bottom: 0.5rem;
}

.command {
  margin: 0.5rem 0 1rem;
  padding: 0.75rem 1rem;
  background: var(--tc-white);
  border: 1px solid var(--tc-field-border);
  color: var(--tc-ink);
  font-family: var(--tc-font-mono);
  font-size: 0.9375rem;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

/* Forms */

form {
  margin: 0;
}

.field {
  margin: 0 0 1.25rem;
}

.field label {
  display: block;
  margin-bottom: 0.375rem;
  font-weight: 700;
}

.field__note {
  color: var(--tc-muted);
  font-weight: 400;
}

input[type="text"],
input[type="email"],
input[type="password"],
select {
  display: block;
  width: 100%;
  max-width: 100%;
  min-height: 2.75rem;
  padding: 0.5rem 0.75rem;
  background: var(--tc-white);
  border: 1px solid var(--tc-field-border);
  color: var(--tc-ink);
  font: inherit;
  line-height: 1.4;
  transition: border-color 150ms ease-out;
}

input[type="text"],
input[type="email"],
input[type="password"] {
  -webkit-appearance: none;
  appearance: none;
}

input[aria-invalid="true"] {
  border-color: var(--tc-danger);
  box-shadow: inset 0 0 0 1px var(--tc-danger);
}

.help {
  margin: 0.375rem 0 0;
  color: var(--tc-muted);
  font-size: 0.9375rem;
}

.error {
  margin: 0.375rem 0 0;
  color: var(--tc-danger);
  font-size: 0.9375rem;
  font-weight: 700;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 1rem 1.5rem;
  margin-top: 1.5rem;
}

.filters .field {
  flex: 1 1 14rem;
  margin: 0;
}

.filters .button {
  flex: 0 0 auto;
}

/* Buttons */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.5rem 1.25rem;
  background: var(--tc-white);
  border: 1px solid var(--tc-teal);
  color: var(--tc-teal);
  font: inherit;
  font-weight: 500;
  line-height: 1.3;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  -webkit-appearance: none;
  appearance: none;
  transition: color 150ms ease-out, background-color 150ms ease-out, border-color 150ms ease-out;
}

.button:hover {
  background: var(--tc-band);
  border-color: var(--tc-teal-light);
  color: var(--tc-teal);
  text-decoration: none;
}

.button--primary {
  background: var(--tc-teal);
  color: var(--tc-white);
}

.button--primary:hover {
  background: var(--tc-teal-light);
  border-color: var(--tc-teal-light);
  color: var(--tc-white);
}

.button--quiet {
  border-color: var(--tc-field-border);
  color: var(--tc-ink);
}

.button--danger {
  background: var(--tc-danger);
  border-color: var(--tc-danger);
  color: var(--tc-white);
}

.button--danger:hover {
  background: var(--tc-ink);
  border-color: var(--tc-ink);
  color: var(--tc-white);
}

.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.form-actions form {
  margin: 0;
}

.field + .button,
.form > .button {
  width: 100%;
}

@media (min-width: 640px) {
  .field + .button,
  .form > .button {
    width: auto;
  }
}

/* Recent changes table */

.log {
  width: 100%;
  margin-top: 1.5rem;
  border-collapse: collapse;
}

.log caption {
  padding-bottom: 0.75rem;
  color: var(--tc-muted);
  font-size: 0.9375rem;
  text-align: left;
}

.log th,
.log td {
  padding: 0.75rem 1rem 0.75rem 0;
  border-bottom: 1px solid var(--tc-rule);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.log th {
  border-bottom-color: var(--tc-teal);
  font-weight: 700;
}

.log td.log__time {
  white-space: nowrap;
}

.log__entries div {
  margin-bottom: 0.125rem;
}

.log__bad {
  color: var(--tc-danger);
  font-weight: 700;
}

.log__ok {
  font-weight: 700;
}

@media (max-width: 639.98px) {
  .log,
  .log tbody,
  .log tr,
  .log td {
    display: block;
  }

  .log caption {
    display: block;
  }

  .log thead {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  .log tr {
    padding: 0.75rem 0;
    border-bottom: 1px solid var(--tc-rule);
  }

  .log td {
    display: grid;
    grid-template-columns: 5.5rem minmax(0, 1fr);
    gap: 0.5rem;
    padding: 0.25rem 0;
    border-bottom: 0;
  }

  .log td::before {
    content: attr(data-label);
    color: var(--tc-muted);
  }

  .log td.log__time {
    white-space: normal;
  }
}

/* Services status table (PRD-003 AC-UI9): a row header per service, and one
   line per login with its Relink button beside it. */

.services tbody th {
  width: 34%;
  border-bottom-color: var(--tc-rule);
}

/* One wrapper per status cell: the stacked layout's grid sees one value. */
.service-status {
  min-width: 0;
  overflow-wrap: anywhere;
}

.grants {
  margin: 0;
  padding: 0;
  list-style: none;
}

.grants li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1rem;
  padding: 0.125rem 0;
}

.grants li + li {
  margin-top: 0.5rem;
}

.grants span {
  overflow-wrap: anywhere;
}

.grants form {
  margin: 0;
}

@media (max-width: 639.98px) {
  .services tbody th {
    display: block;
    width: auto;
    padding: 0 0 0.25rem;
    border-bottom: 0;
  }
}

/* A titled block inside a section (Add a project, Link another login). */

.subsection {
  margin-top: 2.5rem;
}

.subsection h3 {
  margin-bottom: 0.75rem;
}

/* Footer band */

.footer {
  padding-top: 2rem;
  padding-bottom: 2rem;
  background: var(--tc-teal);
  color: var(--tc-white);
}

.footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 0.5rem 2rem;
}

.footer p {
  margin: 0;
}

.footer a {
  color: var(--tc-white);
}

.footer a:hover {
  color: var(--tc-white);
}

/* Keyboard focus: 2px teal outline, 2px offset (white on the teal footer). */

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible {
  outline: 2px solid var(--tc-teal);
  outline-offset: 2px;
}

.footer a:focus-visible {
  outline-color: var(--tc-white);
}

/* Reduced motion */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    transition: none !important;
    animation: none !important;
  }
}
