/* The winery cabinet: its sign-in and its home (M3-WINERY-ACCESS, WAUTH1). The design system's tokens only; fields, notices,
   buttons and the card are the kit's (components.css). The head is the prototype's (professional-login): eyebrow, H1, lead,
   a rule, then the card with the form. */

/* The rule under the head spans the content's width, as the prototype's, not the container's padding */
.cabinet-head {
  padding-block: var(--spacing-24) 0;
  background: linear-gradient(var(--color-border), var(--color-border)) bottom / 100% var(--border-width-1) no-repeat content-box;
}

.cabinet-head > :last-child {
  padding-bottom: var(--spacing-24);
}

.cabinet-head h1 {
  max-width: 24ch;
  margin-bottom: var(--spacing-16);
  overflow-wrap: anywhere;
  hyphens: auto;
}

.cabinet-head .lead {
  max-width: var(--size-44rem);
  margin-bottom: 0;
}

.cabinet-body {
  padding-block: var(--spacing-32) var(--spacing-48);
}

.cabinet-card {
  gap: var(--spacing-16);
  max-width: var(--size-48rem);
  padding: var(--spacing-24);
  overflow: visible;
}

.cabinet-card > h2 {
  margin: 0;
}

.cabinet-card > :last-child {
  margin-bottom: 0;
}

.cabinet-notice p {
  margin: 0;
}

.cabinet-form {
  display: grid;
  gap: var(--spacing-16);
}

.cabinet-form .form-required-note {
  margin: 0;
}

.cabinet-actions {
  margin: 0;
}

.cabinet-help,
.cabinet-note {
  margin: 0;
  color: var(--color-text-secondary);
}

.cabinet-account {
  display: grid;
  gap: var(--spacing-8);
  margin: 0;
}

.cabinet-account > div {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: var(--spacing-4);
}

.cabinet-account dt {
  font-weight: var(--font-weight-semibold);
}

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

@media (min-width: 768px) {
  .cabinet-card {
    padding: var(--spacing-32);
  }

  .cabinet-account > div {
    grid-template-columns: var(--size-12rem) minmax(0, 1fr);
  }
}

/* The annual wine list (M3-WINERY-LIST, WLIST1): the cabinet's cards stay as wide as the page's text; its tables (the file's
   errors, the draft) scroll sideways inside their own container, never the page. */
.cabinet-body > .cabinet-card + .cabinet-card,
.cabinet-body > .notice + .cabinet-card {
  margin-top: var(--spacing-24);
}

.cabinet-body > .notice {
  max-width: var(--size-48rem);
  margin-bottom: var(--spacing-16);
}

.cabinet-card:has(.cabinet-table-scroll) {
  max-width: var(--size-72rem);
}

.cabinet-table-scroll {
  max-width: 100%;
  overflow-x: auto;
}

.annual-table th,
.annual-table td {
  padding: var(--spacing-8) var(--spacing-12);
  border-bottom: var(--border-width-1) solid var(--color-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.annual-table tbody th {
  font-weight: var(--font-weight-medium);
}

/* The password field's show/hide toggle (M4-CABINET, CA-5): a 40 x 40 icon button inside the 48 px field's end, 4 px from its edges */
.password-field {
  position: relative;
}

/* Three classes deep, so it outranks components.css's .field input rule and its 16 px end padding keeps no text under the button */
.field .password-field input:not([type="checkbox"], [type="radio"]) {
  width: 100%;
  padding-inline-end: calc(var(--spacing-8) + var(--spacing-40) + var(--spacing-4));
}

.password-toggle {
  position: absolute;
  inset-block-start: 50%;
  inset-inline-end: var(--spacing-4);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: var(--spacing-40);
  min-height: var(--spacing-40);
  margin: 0;
  padding: 0;
  transform: translateY(-50%);
  border: 0;
  border-radius: var(--border-radius-8);
  background: transparent;
  color: var(--color-icon-base-default);
  cursor: pointer;
}

.password-toggle:hover {
  background-color: var(--color-surface-muted);
}

.password-toggle .icon-eye-off,
.password-toggle[aria-pressed="true"] .icon-eye {
  display: none;
}

.password-toggle[aria-pressed="true"] .icon-eye-off {
  display: block;
}

/* The status tags (M4-CABINET, CA-1): the neutral tag reads #383838 on #F1F1F1 in the cabinet's lists */
.cabinet-account .tag.neutral {
  color: var(--color-text-base-secondary);
}

/* "Înapoi la cabinet" (CA-3): a text button with a left chevron above the page head */
.cabinet-back {
  padding-block: var(--spacing-16) 0;
}

.cabinet-back-link {
  margin: 0;
}

.cabinet-back-link .button {
  gap: var(--spacing-4);
  padding-inline-start: 0;
}

/* The closed-period notice sits over the status card, as the other notices of the cabinet */
.cabinet-closed .notice-title {
  margin-bottom: var(--spacing-4);
}

.cabinet-closed p {
  margin: 0;
}
