/* Account and user-management pages. Global (not scoped) because they are built from tag-helper forms. */

/* ---- Sign-in screen ("Connexion • V2", 1440x1024): 580px white panel + #f7f9fa visual panel. ---- */

.auth-body {
  display: block;
  background: var(--ui-color-background-layer);
}

.auth-screen {
  display: flex;
  min-height: 100vh;
}

.auth-panel {
  position: relative;
  display: flex;
  flex: 0 0 580px;
  flex-direction: column;
  padding: 84px 95px 48px 99px;
  background: var(--ui-color-background-layer);
}

.auth-content {
  display: flex;
  flex: 1;
  flex-direction: column;
  justify-content: center;
  max-width: 386px;
  padding: 48px 0;
}

/* "Welcome to MyLubPortal": Nunito 700 40/55, second line red. */
.auth-welcome {
  margin: 0 0 48px;
  font-family: var(--ui-font-family-heading);
  font-size: 40px;
  font-weight: 700;
  line-height: 55px;
  color: var(--ui-color-foreground-primary);
}

.auth-welcome span {
  color: var(--ui-color-foreground-brand);
}

.auth-form {
  gap: 20px;
}

.auth-remember {
  font-size: 14px;
  line-height: 22px;
}

/* The CAPTCHA picture with the button that asks for another one. */
.auth-captcha {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 8px;
}

.auth-captcha img {
  max-width: 100%;
  height: auto;
  border: 1px solid var(--ui-color-border-field);
  border-radius: 8px;
}

/* Sign-in button: 386x42 red pill. */
.auth-submit {
  width: 100%;
}

.auth-visual {
  position: relative;
  flex: 1;
  overflow: hidden;
  min-height: 100vh;
  background: var(--ui-color-background-muted);
}

/* The exported SVG is centred on the pattern's bounding box in the design (Group 3094). */
.auth-waves {
  position: absolute;
  top: -1380px;
  left: -740px;
  width: 1912px;
  height: 2197px;
  max-width: none;
  pointer-events: none;
}

/* Photos and tagline at their design offsets inside the visual panel (panel starts at x=580). */
.auth-photo-1,
.auth-photo-2 {
  position: absolute;
  display: block;
  max-width: none;
}

.auth-photo-1 {
  top: 144px;
  left: 150px;
  width: 454px;
  height: 612px;
}

.auth-photo-2 {
  top: 303px;
  left: 453px;
  width: 258px;
  height: 347px;
}

.auth-links {
  position: absolute;
  top: 990px;
  left: 173px;
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: 14px;
  line-height: 20px;
  letter-spacing: 0.17px;
  color: var(--ui-color-foreground-secondary);
}

.auth-links-sep {
  width: 1px;
  height: 14px;
  background: var(--ui-color-foreground-primary);
}

@media (max-width: 1100px) {
  .auth-visual {
    display: none;
  }

  .auth-panel {
    flex: 1;
    align-items: center;
    padding: 48px 24px;
  }

  .auth-content {
    width: 100%;
  }
}

@media (max-width: 576px) {
  .auth-welcome {
    font-size: 32px;
    line-height: 44px;
    margin-bottom: 32px;
  }
}

/* ---- Pages inside the main layout (access denied, change password, users). ---- */

.auth-page {
  display: flex;
  justify-content: center;
  padding-top: 64px;
}

.auth-card {
  width: 100%;
  max-width: 480px;
  padding: 32px;
}

.auth-card .ui-page-head {
  margin-bottom: 24px;
}

.page-narrow {
  max-width: 760px;
}

.page-head-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.page-stack {
  display: flex;
  flex-direction: column;
  gap: 24px;
  padding-top: 32px;
}

.form-card {
  padding: 32px;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px 32px;
}

.form-grid .span-2 {
  grid-column: span 2;
}

.role-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 32px;
}

.row-actions {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
}

.row-actions {
  flex-wrap: wrap;
}

/* Same height as the outline buttons beside it. */
.unlock-btn {
  min-height: 32px;
  padding: 5px 14px;
}

/* Supervision: the salesmen a supervisor is linked to. */
.check-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px 32px;
}

.check-grid .ui-check {
  align-items: flex-start;
}

.check-grid .ui-check input {
  flex: none;
  margin-top: 4px;
}

.link-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 16px;
}

.link-others {
  display: block;
}

.link-names {
  margin-top: 4px;
  line-height: 18px;
}

.link-add {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 16px;
}

.link-add .ui-field {
  flex: 1 1 280px;
}

/* Activity log */
.audit-time {
  white-space: nowrap;
}

.audit-detail {
  overflow-wrap: anywhere;
}

/* Targets: a year of monthly boxes per salesman. */
.target-grid td:first-child {
  min-width: 200px;
}

.target-grid .target-month {
  padding: 6px 4px;
  text-align: center;
}

.target-input {
  width: 64px;
  height: 34px;
  padding: 4px;
  font-size: 14px;
  text-align: center;
  /* No spinner arrows: they leave too little room for a figure like 12.345. */
  appearance: textfield;
}

.target-input::-webkit-inner-spin-button,
.target-input::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

/* "Fill rest" is an icon beside the row; its text shows only on the phone card. */
.target-grid .target-fill {
  padding: 6px;
  text-align: center;
}

.target-fill .ui-btn {
  min-height: 32px;
  padding: 5px 8px;
}

.target-fill-text {
  display: none;
}

/* Phones: one card per salesman with the twelve months four across (see the table cards in site.css). */
@media screen and (max-width: 576px) {
  table.target-grid tr {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 8px;
    padding: 10px 12px;
  }

  table.target-grid td {
    min-width: 0;
    padding: 0;
    text-align: start;
  }

  table.target-grid td:is(.stk-title, .target-fill) {
    grid-column: 1 / -1;
  }

  table.target-grid td.target-month::before {
    display: block;
    float: none;
    margin: 0;
  }

  table.target-grid .target-input {
    width: 100%;
  }

  table.target-grid td.target-fill {
    text-align: end;
  }

  .target-fill-text {
    display: inline;
  }
}

/* Roles: one column of checkboxes per role. */
.role-matrix .role-col {
  width: 120px;
  text-align: center;
}

.role-matrix input[type="checkbox"] {
  width: 16px;
  height: 16px;
  accent-color: var(--ui-color-foreground-brand);
}

/* Phones: each permission is a card listing the roles (see the table cards in site.css). */
@media screen and (max-width: 576px) {
  table.role-matrix td.role-col {
    width: auto;
    text-align: right;
  }

  .role-matrix input[type="checkbox"] {
    width: 20px;
    height: 20px;
    vertical-align: middle;
  }
}

@media (max-width: 576px) {
  .auth-page {
    padding-top: 24px;
  }

  .auth-card,
  .form-card {
    padding: 20px;
  }

  .form-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .form-grid .span-2 {
    grid-column: auto;
  }
}
