/* Public storefront controls, measured against the AllPrint print builder. */
:root {
  --ap-control-accent: #005bea;
  --ap-control-accent-hover: #0047b8;
  --ap-control-ink: #17283d;
  --ap-control-muted: #536582;
  --ap-control-border: #8797ad;
  --ap-control-radius: 9px;
  --ap-control-height: 48px;
}

:root body :is(main, dialog) :is(.btn-primary, .btn-secondary),
:root body :is(main, .policy-header) .button,
:root body.review-build :is(#previous-request-check, #previous-request-copy, #previous-request-forget) {
  min-block-size: var(--ap-control-height);
  min-inline-size: 44px;
  max-inline-size: 100%;
  border: 1px solid transparent;
  border-radius: var(--ap-control-radius);
  padding: .625rem 1rem;
  font: 600 .9375rem/1.35 var(--ap-customer-type);
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
}

:root body :is(main, dialog) .btn-primary,
:root body :is(main, .policy-header) .button,
:root body.review-build #previous-request-check {
  background: var(--ap-control-accent);
  border-color: var(--ap-control-accent);
  color: #fff;
}
:root body :is(main, dialog) .btn-primary:not(:disabled):not([aria-disabled="true"]):hover,
:root body :is(main, .policy-header) a.button[href]:hover,
:root body.review-build #previous-request-check:enabled:hover {
  background: var(--ap-control-accent-hover);
  border-color: var(--ap-control-accent-hover);
}
:root body :is(main, dialog) .btn-secondary,
:root body.review-build :is(#previous-request-copy, #previous-request-forget) {
  background: #fff;
  border-color: var(--ap-control-border);
  color: var(--ap-control-ink);
}
:root body :is(main, dialog) .btn-secondary:not(:disabled):not([aria-disabled="true"]):hover,
:root body.review-build :is(#previous-request-copy, #previous-request-forget):enabled:hover {
  background: #edf4ff;
  border-color: var(--ap-control-accent);
}
:root body :is(main, dialog) :is(.btn-primary, .btn-secondary):is(:disabled, [aria-disabled="true"]),
:root body.review-build :is(#previous-request-check, #previous-request-copy, #previous-request-forget):disabled {
  background: #f3f5f9;
  border-color: #cfd7e5;
  color: var(--ap-control-muted);
  opacity: 1;
  cursor: not-allowed;
}

/* The legacy quote stylesheet sets shorter controls inside this region. */
:root body.order-page .order-main .btn { min-block-size: var(--ap-control-height); }

:root body #selection-dialog .dialog-legend {
  font: 600 .9375rem/1.4 var(--ap-customer-type);
}
:root body #selection-dialog :is(.qty-step-btn, .btn-quick-qty) {
  min-block-size: var(--ap-control-height);
  min-inline-size: 44px;
  border-radius: var(--ap-control-radius);
  font-family: var(--ap-customer-type);
}
:root body #selection-dialog #dialog-qty,
:root body.review-build.builder-page :is(select, input[type="text"], input[type="email"], input[type="number"], textarea) {
  min-block-size: var(--ap-control-height);
  border-color: var(--ap-control-border);
  border-radius: 4px;
  background-color: #fff;
  color: var(--ap-control-ink);
  font-family: var(--ap-customer-type);
  font-size: .9375rem;
}
:root body.review-build.builder-page textarea { min-block-size: 80px; }
:root body :is(#selection-dialog #dialog-qty, .main-content input, .main-content select, .main-content textarea)[aria-invalid="true"] {
  border-color: #b3261e;
  background-color: #fff8f8;
}

:root body :is(main, dialog) :is(.btn-primary, .btn-secondary, .button, input, select, textarea, .qty-step-btn, .btn-quick-qty):focus-visible,
:root body .policy-header .button:focus-visible,
:root body.review-build :is(#previous-request-check, #previous-request-copy, #previous-request-forget):focus-visible {
  outline: 3px solid var(--ap-control-accent);
  outline-offset: 3px;
}

:root body.review-build.builder-page #upload-capability-notice,
:root body.order-page #page-status {
  color: var(--ap-control-muted);
  font: 400 1rem/1.55 var(--ap-customer-type);
}
:root body #page-status:not(:empty) { min-block-size: 1.55em; }

@media (max-width: 640px) {
  :root body #selection-dialog #dialog-qty,
  :root body.review-build.builder-page :is(select, input[type="text"], input[type="email"], input[type="number"], textarea) {
    font-size: 1rem;
  }
}
