/* E1 (SLDS phase 2): form fields, buttons, notices and the "Save changes?" step in the Orona skin
   (templates/slds/_field.html, _check.html, _error_summary.html, _notice.html, _confirm_row.html;
   platform_core/slds_forms.py). Loaded after css/orona-slds.css. Every rule is under .slds-scope,
   so nothing outside one changes. Colours only from docs/11, through the --orona-*
   variables of css/orona-base.css; white is the only hex. Small text (under 14 px) is navy (F71); white
   text sits on the darker green, never on the brand green (F379); red is only "needs action", with its
   word and icon. Flat and square, no shadow. Phone (under 768 px): every control, button and
   choice label is at least 44 px tall. */

/* ---- Fields (GOV.UK pattern on SLDS classes) ---- */
.slds-scope .o-field { margin: 0 0 16px; padding: 0; border: 0; min-width: 0; }
.slds-scope .o-field__label { display: block; margin: 0 0 4px; color: var(--orona-navy); font-size: 14px; font-weight: 600; overflow-wrap: anywhere; }
.slds-scope .o-field__optional { color: var(--orona-navy); font-weight: 400; }
.slds-scope .o-field__hint { margin: 0 0 4px; color: var(--orona-navy); font-size: 13px; font-weight: 400; max-width: 48rem; }
.slds-scope .o-field__error { display: flex; gap: 6px; align-items: flex-start; margin: 0 0 6px; color: var(--orona-red); font-size: 14px; font-weight: 600; }
/* E32c: the display above beats the hidden attribute once Tabler's [hidden] rule goes (E33). */
.slds-scope .o-field__error[hidden] { display: none; }
.slds-scope .o-field__error .icon { width: 16px; height: 16px; margin-top: 2px; }
.slds-scope .slds-input,
.slds-scope .slds-select,
.slds-scope .slds-textarea { min-height: 36px; width: 100%; color: var(--orona-body); font-size: 14px; font-family: var(--orona-font); border: 1px solid var(--orona-rule); }
.slds-scope .o-field__control,
.slds-scope .slds-select_container.o-field__control { max-width: 32rem; }
.slds-scope .slds-textarea.o-field__control { max-width: 48rem; }
.slds-scope .slds-input:focus,
.slds-scope .slds-select:focus,
.slds-scope .slds-textarea:focus { border-color: var(--orona-navy); }
.slds-scope .slds-input[aria-invalid="true"],
.slds-scope .slds-select[aria-invalid="true"],
.slds-scope .slds-textarea[aria-invalid="true"] { border: 2px solid var(--orona-red); }
.slds-scope .slds-input[disabled],
.slds-scope .slds-select[disabled],
.slds-scope .slds-textarea[disabled] { background-color: var(--orona-grey); color: var(--orona-navy); cursor: not-allowed; }

/* Checkboxes and radios: the input covers its whole label (opacity 0), so the label is the hit
   area and the input itself is the 44 px target on a phone; the drawn box carries the focus. */
.slds-scope .o-field__options { display: grid; gap: 4px; }
.slds-scope .o-check { position: relative; display: flex; align-items: center; max-width: 32rem; }
.slds-scope .o-check input[type="checkbox"],
.slds-scope .o-check input[type="radio"] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; clip: auto; opacity: 0; cursor: pointer; z-index: 1; }
.slds-scope .o-check__label { display: inline-flex; align-items: center; gap: 4px; min-height: 28px; }
.slds-scope .o-check__text { margin: 0; color: var(--orona-navy); font-size: 14px; font-weight: 400; overflow-wrap: anywhere; }
.slds-scope .o-check__hint { margin-left: 28px; }
/* On the vendored focus selectors (0-6-0, this sheet loads later): the 0-5-0 `.o-check input:focus-visible`
   form lost to their `outline: 2px solid transparent`, so a focused box showed no focus (Sentinel s431). */
.slds-scope .slds-checkbox [type=checkbox]:focus-visible + .slds-checkbox__label .slds-checkbox_faux,
.slds-scope .slds-radio [type=radio]:focus-visible + .slds-radio__label .slds-radio_faux { outline: 2px solid var(--orona-navy); outline-offset: 2px; }
/* The navy box sits on the vendored base selectors (0-3-0, this sheet loads later): a bare
   `.slds-scope .slds-checkbox_faux` (0-2-0) lost to them and drew SLDS's grey #747474 (sbriefs10). */
.slds-scope .slds-checkbox .slds-checkbox_faux,
.slds-scope .slds-radio .slds-radio_faux { border-color: var(--orona-navy); }
.slds-scope .slds-radio .slds-radio_faux { --slds-c-radio-color-border-checked: var(--orona-navy); --slds-c-radio-color-border-focus: var(--orona-navy); }  /* picked, focused: the vendored :checked and :focus rules read them */
.slds-scope .slds-has-error .slds-checkbox_faux,
.slds-scope .slds-has-error .slds-radio_faux { border: 2px solid var(--orona-red); }
/* E1c: the tick, the half-tick and the radio dot in brand green #00A532 (F379: "ticks"; E1c-Q1 P B),
   not SLDS blue. The box keeps E1's navy border; an error keeps the red mark and a disabled box the grey
   one (the vendored rules set those colours directly, so they win over these tokens). */
.slds-scope .slds-checkbox,
.slds-scope .slds-radio {
  --slds-c-checkbox-mark-color-foreground: var(--orona-green);
  --slds-c-radio-mark-color-foreground: var(--orona-green);
}

/* ---- Error summary: white, a thin rule and the red band on its left; links navy, underlined. */
.slds-scope .o-error-summary { margin: 0 0 16px; padding: 12px 16px; background: #FFFFFF; border: 1px solid var(--orona-rule); border-left: 4px solid var(--orona-red); max-width: 48rem; }
.slds-scope .o-error-summary__title { margin: 0 0 8px; color: var(--orona-navy); font-size: 16px; font-weight: 700; }
.slds-scope .o-error-summary__list { margin: 0; padding: 0; list-style: none; }
.slds-scope .o-error-summary__list li { margin: 0 0 4px; }
.slds-scope .o-error-summary__list a { color: var(--orona-navy); font-size: 14px; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
/* A person number ("M-0002") kept whole on one line in an error, a summary link or a title
   (platform_core keep_refs; Designer d-1032f M1). */
.slds-scope .o-nowrap { white-space: nowrap; }
/* The summary takes the focus after a submit, by mouse as by keyboard: the ring shows on :focus,
   not only :focus-visible (GOV.UK; the sign-in page's own rule; Designer d-1032f F2). */
.slds-scope .o-error-summary:focus { outline: 2px solid var(--orona-navy); outline-offset: 2px; }

/* ---- Buttons: brand and neutral are D14's (css/orona-slds.css); E1 adds the destructive pair
   (through SLDS's own hooks) and the disabled look in Orona colours. Hover and active go navy. */
.slds-scope .slds-button { gap: 6px; }
.slds-scope .slds-button .icon { width: 16px; height: 16px; }
.slds-scope .slds-button_destructive {
  --slds-c-button-destructive-color-background: var(--orona-red);
  --slds-c-button-destructive-color-border: var(--orona-red);
  --slds-c-button-destructive-text-color: #FFFFFF;
  --slds-c-button-destructive-color-background-hover: var(--orona-navy);
  --slds-c-button-destructive-color-border-hover: var(--orona-navy);
  --slds-c-button-destructive-text-color-hover: #FFFFFF;
  --slds-c-button-destructive-color-background-active: var(--orona-navy);
  --slds-c-button-destructive-color-border-active: var(--orona-navy);
  --slds-c-button-destructive-text-color-active: #FFFFFF;
  font-weight: 700; font-size: 14px;
}
/* Text-destructive: red text, no fill and no border in every state, so it sits on a white row and
   on the grey step panel alike. Plain properties, not SLDS's hooks: a hook would need a colour
   (SLDS's own is a white fill, a grey border and a grey hover). */
.slds-scope .slds-button_text-destructive {
  --slds-c-button-text-destructive-text-color: var(--orona-red);
  font-weight: 600; font-size: 14px;
}
.slds-scope .slds-button_text-destructive,
.slds-scope .slds-button_text-destructive:hover,
.slds-scope .slds-button_text-destructive:focus,
.slds-scope .slds-button_text-destructive:active { background-color: transparent; border-color: transparent; }
.slds-scope .slds-button_text-destructive:hover,
.slds-scope .slds-button_text-destructive:focus { color: var(--orona-red); text-decoration: underline; }
.slds-scope .slds-button:disabled,
.slds-scope .slds-button[disabled],
.slds-scope .slds-button_brand:disabled,
.slds-scope .slds-button_destructive:disabled,
.slds-scope .slds-button_neutral:disabled { background-color: var(--orona-grey); border-color: var(--orona-rule); color: var(--orona-navy); font-weight: 400; cursor: not-allowed; }

/* ---- Notices (stay on the page): the D12 banner geometry (css/orona-crm-record.css .o-banner). */
.slds-scope .o-notice { display: flex; gap: 10px; align-items: flex-start; margin: 0 0 12px; padding: 10px 14px; background: #FFFFFF; border: 1px solid var(--orona-rule); border-left: 4px solid var(--orona-navy); color: var(--orona-body); font-size: 14px; max-width: 48rem; }
.slds-scope .o-notice__icon { display: inline-flex; color: var(--orona-navy); padding-top: 1px; }
.slds-scope .o-notice__text { margin: 0; color: var(--orona-body); overflow-wrap: anywhere; }
.slds-scope .o-notice__link { color: var(--orona-navy); font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.slds-scope .o-notice_success { border-left-color: var(--orona-green); }
.slds-scope .o-notice_success .o-notice__icon { color: var(--orona-green); }
.slds-scope .o-notice_warning { border-left-color: var(--orona-amber); }
.slds-scope .o-notice_error { border-left-color: var(--orona-red); }
.slds-scope .o-notice_error .o-notice__icon { color: var(--orona-red); }

/* ---- "Save changes?" / "Remove?" (docs/11): panel grey, the green band, a bold navy title, one
   sentence; Save green, Back / Cancel navy outline, "Yes, remove" red. */
.slds-scope .o-confirm { max-width: 640px; white-space: normal; padding: 16px; background: var(--orona-grey); border-left: 4px solid var(--orona-green); }
.slds-scope .o-confirm__title { margin: 0 0 4px; color: var(--orona-navy); font-size: 16px; font-weight: 700; }
.slds-scope .o-confirm__text { margin: 0 0 8px; color: var(--orona-body); font-size: 14px; overflow-wrap: anywhere; }
.slds-scope .o-confirm__undo { margin: 0 0 8px; color: var(--orona-navy); font-size: 14px; font-weight: 600; }
.slds-scope .o-confirm__form { margin: 0; }
.slds-scope .o-confirm__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 12px; }
.slds-scope .o-confirm__actions .slds-button_neutral { border-color: var(--orona-navy); }
.slds-scope .o-confirm-row > td { padding: 0; }

/* ---- The form's own actions row. */
.slds-scope .o-form__actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }

/* ---- The library page's demo (/design/, made-up rows). */
.slds-scope .o-lib__form { max-width: 48rem; }
.slds-scope .o-lib__states { display: grid; gap: 0 24px; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); }
.slds-scope .o-lib__confirm td, .slds-scope .o-lib__confirm th { vertical-align: middle; overflow-wrap: anywhere; }
.slds-scope .o-lib__confirm-acts { display: flex; flex-wrap: wrap; gap: 8px; justify-content: flex-end; }
/* The actions cell is as narrow as it can be (D10's width: 1%); a button label never breaks inside a word. */
.slds-scope .o-lib__confirm .o-lib__actions { overflow-wrap: normal; white-space: nowrap; }

@media (max-width: 767.98px) {
  .slds-scope .slds-input,
  .slds-scope .slds-select,
  .slds-scope .slds-textarea,
  .slds-scope .o-field .slds-button,
  .slds-scope .o-form__actions .slds-button,
  .slds-scope .o-lib__row .slds-button,
  .slds-scope .o-confirm__actions .slds-button,
  .slds-scope .o-lib__confirm .slds-button { min-height: 44px; }
  .slds-scope .o-check { min-height: 44px; }
  .slds-scope .o-check__label { min-height: 44px; }
  .slds-scope .o-form__actions .slds-button,
  .slds-scope .o-confirm__actions .slds-button { width: 100%; justify-content: center; }
  .slds-scope .o-error-summary__list a,
  .slds-scope .o-notice__link { display: inline-flex; align-items: center; min-height: 44px; }
  .slds-scope .o-lib__confirm thead { display: none; }
  .slds-scope .o-lib__confirm,
  .slds-scope .o-lib__confirm tbody,
  .slds-scope .o-lib__confirm tr,
  .slds-scope .o-lib__confirm th,
  .slds-scope .o-lib__confirm td { display: block; width: 100%; }
  .slds-scope .o-lib__confirm tr { padding: 4px 0; }
  .slds-scope .o-lib__confirm-acts { justify-content: flex-start; }
}

/* BUG1a: a file control (<input type="file" class="o-field__control">, the problem report's
   screenshot), drawn by the browser: the width of its column, body text, and a 44 px target on a
   phone like every control here. */
.slds-scope input[type="file"].o-field__control { display: block; width: 100%; padding: 6px 0; color: var(--orona-body); font-size: 14px; font-family: var(--orona-font); }
@media (max-width: 767.98px) {
  .slds-scope input[type="file"].o-field__control { min-height: 44px; padding: 10px 0; }
}
