/* MyClinicFlo EMR sign-in. Colours and corners follow the MyClinicFlo
   design tokens (blue #075db8, 6px controls, 8px cards); Inter is the
   product face (SIL Open Font License 1.1, https://rsms.me/inter). */
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400 640;
  font-display: swap;
  src: url(inter-latin.woff2) format('woff2');
}

.mcf-login {
  --primary: #075db8;
  --primary-ink: #064785;
  --primary-soft: #edf5ff;
  --ground: #ffffff;
  --surface: #f7f8fa;
  --ink: #10131a;
  --ink-soft: #545a67;
  --ink-faint: #646b78;
  --line: #e4e7ec;
  --line-strong: #cbd1da;
  --danger: #a4231a;
  --danger-soft: #fdf1f0;
  --control: 6px;
  --card: 8px;
  --gap: 32px;
}

html:has(> body.mcf-login) {
  height: auto;
  min-height: 100%;
  overflow-x: hidden;
  overflow-x: clip;
  background: #f4f8fd;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body.mcf-login {
  box-sizing: border-box;
  height: auto;
  min-height: 100vh;
  min-height: 100dvh;
  margin: 0;
  overflow-x: hidden;
  overflow-x: clip;
  isolation: isolate;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: max(24px, env(safe-area-inset-top)) max(24px, env(safe-area-inset-right))
           max(24px, env(safe-area-inset-bottom)) max(24px, env(safe-area-inset-left));
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink);
  background: linear-gradient(180deg, #ffffff 0%, var(--primary-soft) 100%);
  background-attachment: fixed;
}
.mcf-login *, .mcf-login *::before, .mcf-login *::after { box-sizing: border-box; }

/* The build-info span stays in the markup but never shows here. */
.mcf-login .topbar { display: none; }

/* The lockup and card sit centred in the space above the licence footer. */
.mcf-login .content {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

/* One column: lockup, then card. The ribbon runs behind the card. */
.mcf-login .shell {
  width: 100%;
  max-width: 400px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

.mcf-login .brand { grid-area: brand; }
.mcf-login .stage { grid-area: form; }
.mcf-login .lockup {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 0;
  font-size: inherit;
  font-weight: inherit;
  line-height: 1;
}
.mcf-login .lockup img {
  display: block;
  width: auto;
  height: 44px;
  max-width: none;
}
.mcf-login .lockup .product {
  padding-left: 14px;
  border-left: 1px solid var(--line-strong);
  font-size: 22px;
  font-weight: 560;
  letter-spacing: 0.02em;
  line-height: 32px;
  color: var(--ink-soft);
}
.mcf-login .clinic { margin-top: 12px; color: var(--ink-soft); }
.mcf-login .clinic h2 { margin: 0; font-size: 18px; font-weight: 600; line-height: 1.4; }
.mcf-login .clinic a { color: var(--ink); text-decoration: none; }

/* The sign-in card, riding the ribbon. */
.mcf-login .stage { grid-area: form; position: relative; isolation: isolate; }
.mcf-login .stage::before {
  content: "";
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 50%;
  width: 2400px;
  height: calc(100% + 96px);
  transform: translate(-50%, -50%);
  background: url(flo-ribbon.svg) center / 100% 100% no-repeat;
  pointer-events: none;
}
.mcf-login .signin.card {
  margin: 0;
  padding: 28px 24px 24px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--card);
  box-shadow: 0 1px 2px rgba(16, 19, 26, 0.06), 0 12px 32px rgba(7, 71, 133, 0.14);
  color: var(--ink);
}
.mcf-login .signin form { margin: 0; display: grid; row-gap: 12px; }
.mcf-login .signin .field { position: relative; margin: 0; }

.mcf-login .signin .form-control {
  display: block;
  width: 100%;
  height: 44px;
  margin: 0;
  padding: 0 14px;
  font: inherit;
  font-size: 16px;
  color: var(--ink);
  background: var(--ground);
  border: 1px solid var(--line-strong);
  border-radius: var(--control);
  box-shadow: none;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.mcf-login .signin .form-control::placeholder { color: var(--ink-faint); opacity: 1; }
.mcf-login .signin .form-control:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(7, 93, 184, 0.22);
}
.mcf-login .signin .is-invalid .form-control { border-color: var(--danger); }
.mcf-login .signin .is-invalid .form-control:focus {
  border-color: var(--danger);
  box-shadow: 0 0 0 3px rgba(164, 35, 26, 0.18);
}
/* The page focuses Username on load (setfocus); no ring until the person acts. */
.mcf-login.focus-quiet .signin .form-control:focus { border-color: var(--line-strong); box-shadow: none; }
.mcf-login.focus-quiet .signin .is-invalid .form-control:focus { border-color: var(--danger); }
.mcf-login .signin .toggle-input { padding-right: 48px; }
.mcf-login #password::-ms-reveal, .mcf-login #password::-ms-clear { display: none; }
.mcf-login .secure-text { -webkit-text-security: disc; }

/* Show/hide for password and PIN: the eye, drawn as a mask in ink-faint. */
.mcf-login .toggle-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  margin: 0;
  padding: 0;
  border: 0;
  cursor: pointer;
  background-color: var(--ink-faint);
  -webkit-mask: var(--eye) center / 22px 22px no-repeat;
  mask: var(--eye) center / 22px 22px no-repeat;
  --eye: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/></svg>');
}
.mcf-login .toggle-input:not(.secure-text):not([type="password"]) + .toggle-btn {
  --eye: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2"><path d="M1 12s4-8 11-8 11 8 11 8-4 8-11 8-11-8-11-8z"/><circle cx="12" cy="12" r="3"/><line x1="2" y1="22" x2="22" y2="2"/></svg>');
}
.mcf-login .toggle-btn:hover { background-color: var(--ink-soft); }

.mcf-login .signin .hint {
  display: block;
  margin-top: 12px;
  font-size: 14px;
  line-height: 20px;
  color: var(--ink-soft);
}

.mcf-login .signin .alert {
  margin: 0 0 16px;
  padding: 10px 12px;
  font-size: 15px;
  line-height: 1.4;
  color: var(--danger);
  background: var(--danger-soft);
  border: 1px solid rgba(164, 35, 26, 0.2);
  border-radius: var(--control);
}

.mcf-login #buttonContainer { display: flex; gap: 12px; margin-top: 8px; }
.mcf-login #buttonContainer .btn {
  flex: 1 1 0;
  width: auto;
  height: 44px;
  margin: 0;
  padding: 0 16px;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  line-height: 42px;
  border-radius: var(--control);
  border: 1px solid var(--primary);
  color: #ffffff;
  background: var(--primary);
  box-shadow: none;
  cursor: pointer;
}
.mcf-login #buttonContainer .btn:hover { background: var(--primary-ink); border-color: var(--primary-ink); color: #ffffff; }
.mcf-login #buttonContainer .btn:active { transform: translateY(1px); }
.mcf-login #buttonContainer .btn:focus-visible,
.mcf-login .toggle-btn:focus-visible,
.mcf-login a:focus-visible {
  outline: 2px solid var(--primary);
  outline-offset: 2px;
}

.mcf-login .aua-note { display: block; margin-top: 16px; font-size: 14px; color: var(--ink-soft); }
.mcf-login .aua-note a { color: var(--primary-ink); text-decoration: underline; text-underline-offset: 3px; }

.mcf-login .auaContainer { grid-area: aua; margin: 0; padding: 0; width: auto; }
.mcf-login .auaContainer .card {
  padding: 20px 24px;
  background: var(--ground);
  border: 1px solid var(--line);
  border-radius: var(--card);
  text-align: left;
}
.mcf-login .auaContainer .card-header { padding: 0 0 8px; font-size: 16px; font-weight: 600; background: none; border: 0; }
.mcf-login .auaContainer .card-body { padding: 0; font-size: 14px; color: var(--ink-soft); }
.mcf-login .auaContainer .card-footer { display: none; }

.mcf-login .powered { grid-area: powered; margin: 0; width: auto; color: var(--ink-soft); font-size: 14px; }
.mcf-login .powered a { color: var(--primary-ink); }

/* The GPL notice, in full: one quiet line at the foot of the page. */
.mcf-login footer {
  flex: 0 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 24px auto 0;
  padding: 0;
  position: static;
  font-size: 12px;
  line-height: 18px;
  text-align: center;
  color: var(--ink-faint);
}
.mcf-login footer .extrasmall { font-size: inherit; }
.mcf-login footer a { color: var(--primary-ink); }

/* Phones and both Duo screens: every line at 16px or more. */
@media (max-width: 1000px) {
  .mcf-login .signin .hint, .mcf-login .aua-note,
  .mcf-login .auaContainer .card-body, .mcf-login .powered { font-size: 16px; line-height: 1.5; }
  .mcf-login .signin .alert { font-size: 16px; }
  .mcf-login .lockup img { height: 40px; }
  .mcf-login .lockup .product { font-size: 20px; line-height: 28px; }
}

/* Landscape with little height (the Duo folded, sideways): lockup on the
   left, card on the right, the ribbon behind both. */
@media (orientation: landscape) and (max-height: 560px) {
  .mcf-login { --gap: 24px; }
  .mcf-login .shell {
    max-width: 880px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    grid-template-rows: auto auto auto 1fr;
    grid-template-areas: "brand form" "aua form" "powered form" ". form";
    column-gap: 32px;
    row-gap: 0;
    align-content: center;
    align-items: start;
  }
  /* Row gaps would also open around the empty rows, so anything optional
     under the lockup spaces itself. */
  .mcf-login .auaContainer, .mcf-login .powered { margin-top: var(--gap); }
  .mcf-login .stage { align-self: center; grid-row: 1 / -1; }
  /* The licence sits at the foot of the left column, so the card keeps the
     full height (the failed-sign-in message included). */
  body.mcf-login { position: relative; }
  .mcf-login .stage::before { transform: translate(-50%, calc(-50% - 48px)); }
  .mcf-login footer {
    position: absolute;
    left: calc((100% - min(100% - 48px, 880px)) / 2);
    bottom: max(24px, env(safe-area-inset-bottom));
    width: calc((min(100% - 48px, 880px) - 32px) / 2);
    max-width: none;
    margin: 0;
    text-align: left;
  }
  .mcf-login .signin.card { padding: 24px 20px 20px; }
}

@media (prefers-reduced-motion: reduce) {
  .mcf-login .signin .form-control { transition: none; }
  .mcf-login #buttonContainer .btn:active { transform: none; }
}
