@font-face {
  font-family: "Altaris Login Inter";
  src: url("./assets/inter-login-variable.woff2") format("woff2");
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

/* The shared sidebar also hosts other signed-out panels. Style only the visible auth form. */
.app-shell.auth-locked:has(#cloudAuthForm:not(.is-hidden)) {
  --login-background: #17191b;
  --login-surface: #25282b;
  --login-control: #383c40;
  --login-border: #52585d;
  --login-text: #d9dee1;
  --login-muted: #aeb9bd;
  --login-primary: #478d91;
  --login-info: #718db5;
  --login-success: #6e9c83;
  --login-warning: #c2a15c;

  background: var(--login-background);
  color: var(--login-text);
  font: 400 16px/1.5 "Altaris Login Inter", Inter, system-ui, sans-serif;
  color-scheme: dark;

  & .sidebar {
    padding: clamp(20px, 4vw, 56px);
  }

  & .profile-card {
    grid-template-columns: minmax(0, 1fr) minmax(0, 440px);
    grid-template-areas: "logo form" "name form" "role form" "verse form" ". credit";
    grid-template-rows: 1fr auto auto 1fr auto;
    column-gap: clamp(32px, 8vw, 120px);
    width: min(100%, 940px);
    min-height: 0;
    overflow: visible;
    background: none;
    border: 0;
    border-radius: 0;
    box-shadow: none;
  }

  & .auth-brand-logo {
    content: url("./assets/altaris-login-symbol.png");
    grid-area: logo;
    align-self: end;
    width: 136px;
    height: 136px;
    margin: 0 0 12px;
    filter: none;
  }

  & .profile-name {
    grid-area: name;
    margin: 0;
    font-size: clamp(36px, 4.4vw, 58px);
    font-weight: 680;
    line-height: 1.08;
    letter-spacing: -.045em;
  }

  & .profile-brand-altaris {
    color: var(--login-text);
  }

  & .profile-brand-web {
    color: var(--login-info);
  }

  & .profile-role {
    grid-area: role;
    margin: 10px 0 0;
    color: var(--login-muted);
    font-size: 15px;
    line-height: 1.55;
  }

  & .profile-verse {
    grid-area: verse;
    align-self: start;
    margin: 28px 0 0;
    padding-top: 16px;
    border-top: 1px solid var(--login-border);
    color: var(--login-muted);
    font-size: 13px;
    line-height: 1.55;
  }

  & .profile-verse > div {
    color: inherit;
  }

  & .profile-verse > :last-child {
    margin-top: 6px;
    font-size: 12px;
  }

  & .cloud-auth-card {
    grid-area: form;
    width: 100%;
    margin: 0;
    padding: clamp(20px, 4vw, 32px);
    gap: 20px;
    background: var(--login-surface);
    border: 1px solid var(--login-border);
    border-radius: 4px;
    box-shadow: none;
  }

  & .cloud-auth-head {
    gap: 5px;
    margin: 0;
  }

  & .cloud-auth-head h2 {
    color: var(--login-text);
    font-size: 28px;
    font-weight: 650;
    line-height: 1.2;
    text-align: left;
  }

  & .cloud-auth-head p {
    color: var(--login-muted);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
  }

  & #cloudAuthForm {
    gap: 14px;
  }

  & .cloud-auth-mode-switch {
    gap: 8px;
    margin: 0 0 3px;
    padding-bottom: 14px;
    border-bottom: 1px solid var(--login-border);
  }

  & .cloud-auth-mode,
  & .cloud-auth-actions .btn {
    min-height: 44px;
    background: var(--login-control);
    color: var(--login-text);
    border: 1px solid var(--login-border);
    border-radius: 4px;
    box-shadow: none;
    font: 620 14px/1.35 "Altaris Login Inter", Inter, system-ui, sans-serif;
    transform: none;
  }

  & .cloud-auth-mode.is-active {
    background: var(--login-background);
    border-color: var(--login-primary);
  }

  & .cloud-auth-actions {
    margin: 0;
  }

  & .cloud-auth-actions .btn {
    background: var(--login-primary);
    color: var(--login-background);
    border-color: var(--login-primary);
    font-weight: 700;
  }

  & .cloud-auth-mode:hover,
  & .cloud-auth-actions .btn:hover:not(:disabled) {
    border-color: var(--login-text);
  }

  & .cloud-auth-actions .btn:disabled {
    background: var(--login-control);
    color: var(--login-muted);
    border-color: var(--login-border);
    opacity: 1;
    cursor: wait;
  }

  & .cloud-auth-field {
    gap: 6px;
    color: var(--login-text);
    font-size: 14px;
    font-weight: 550;
  }

  & .cloud-auth-field input {
    min-height: 46px;
    padding: 0 12px;
    border: 1px solid var(--login-border);
    border-radius: 4px;
    background: var(--login-control);
    color: var(--login-text);
    -webkit-text-fill-color: var(--login-text);
    caret-color: var(--login-text);
    font: 400 16px/1.5 "Altaris Login Inter", Inter, system-ui, sans-serif;
  }

  & .cloud-auth-field input::placeholder {
    color: var(--login-muted);
    -webkit-text-fill-color: var(--login-muted);
    opacity: 1;
  }

  & .cloud-auth-field input:focus {
    background: var(--login-control);
    border-color: var(--login-primary);
    box-shadow: none;
  }

  & .cloud-auth-field input:-webkit-autofill {
    box-shadow: none;
  }

  & .cloud-auth-field input.is-invalid {
    border-color: var(--login-warning);
    box-shadow: none;
    animation: none;
  }

  & :is(button, input, a):focus-visible {
    outline: 2px solid var(--login-primary);
    outline-offset: 2px;
  }

  & #cloudInviteNotice:not(.is-hidden) {
    margin: 0;
    padding: 8px 10px;
    gap: 8px;
    border: 1px solid var(--login-border);
    border-radius: 4px;
    background: var(--login-surface);
    color: var(--login-text);
    font-size: 12px;
    box-shadow: none;
  }

  & #cloudAuthForm > .cloud-auth-hint:not(#cloudInviteNotice) {
    display: none;
  }

  & #cloudInviteNotice .cloud-auth-hint-dot {
    width: 7px;
    height: 7px;
    margin-top: 6px;
    background: var(--login-info);
    box-shadow: none;
  }

  & .cloud-auth-status {
    margin: 0;
    padding: 9px 10px;
    border: 1px solid var(--login-border);
    border-inline-start: 3px solid var(--login-info);
    border-radius: 4px;
    background: var(--login-background);
    color: var(--login-text);
    text-align: left;
    font-size: 13px;
    line-height: 1.5;
  }

  & .cloud-auth-status[data-status="ok"] {
    border-inline-start-color: var(--login-success);
  }

  & .cloud-auth-status[data-status="warning"],
  & .cloud-auth-status[data-status="error"] {
    border-inline-start-color: var(--login-warning);
  }

  & .cloud-login-credit {
    grid-area: credit;
    margin: 14px 0 0;
    padding: 0;
    color: var(--login-muted);
    text-align: center;
    font-size: 11px;
  }

  @media (max-width: 740px) {
    & .profile-card {
      width: min(100%, 440px);
      grid-template-columns: auto minmax(0, 1fr);
      grid-template-areas: "logo name" "logo role" "form form" "verse verse" "credit credit";
      grid-template-rows: repeat(5, auto);
      column-gap: 12px;
    }

    & .auth-brand-logo {
      align-self: center;
      width: 60px;
      height: 60px;
      margin: 0;
    }

    & .profile-name {
      align-self: end;
      font-size: 30px;
    }

    & .profile-role {
      margin: 2px 0 0;
      font-size: 13px;
    }

    & .profile-verse {
      margin-top: 18px;
      padding-top: 12px;
    }

    & .cloud-auth-card {
      margin-top: 20px;
    }

    & .cloud-auth-head h2 {
      font-size: 25px;
    }
  }
}
