/* ACS Pricing Calculator */
.acs-pricing-calculator-wrapper {
    --acs-pricing-ink: var(--color-ink, #251f20);
    --acs-pricing-muted: var(--color-ink-400, #424242);
    --acs-pricing-accent: var(--color-chromium-blue-500, #412bfd);
    --acs-pricing-accent-ink: var(--color-chromium-blue-600, #1a00c6);
    --acs-pricing-note: var(--color-chromium-blue-100, #f2f4ff);
    --acs-pricing-border: var(--color-neutral-500, #d0d0d0);
    --acs-pricing-error: var(--color-red-600, #b6281e);
    max-width: 55rem;
    color: var(--acs-pricing-ink);
    font: inherit;
    line-height: 1.45;
}

.acs-pricing-calculator-wrapper [hidden] {
    display: none !important;
}

.acs-pricing-calculator-wrapper a:not(.acs-btn) {
    color: var(--acs-pricing-accent-ink);
    text-decoration: underline;
    text-underline-offset: .15em;
}

.acs-pricing-form-container,
.acs-pricing-results-container {
    background: #fff;
    border: 1px solid var(--color-neutral-400, #e0e0e0);
    border-radius: 1.5rem;
    padding: clamp(1.25rem, 5vw, 2.5rem);
    min-width: 0;
}

.acs-pricing-form-container > * + *,
.acs-pricing-results > * + * {
    margin-top: 1.25rem;
}

.acs-pricing-calculator-wrapper :is(.acs-pricing-form-title, .acs-pricing-results-title) {
    margin: 0;
    font-size: clamp(1.5rem, 4vw, 2.25rem);
    font-weight: 400;
    letter-spacing: -.02em;
    line-height: 1.2;
    color: var(--acs-pricing-ink);
}

.acs-pricing-intro > p {
    margin: 0;
}

.acs-pricing-intro > p + p {
    margin-top: .75rem;
}

.acs-pricing-form > * + * {
    margin-top: 1.5rem;
}

.acs-form-field {
    padding: 0;
    border: 0;
    min-inline-size: 0;
}

.acs-field-prompt,
.acs-field-label,
.acs-terms-prompt {
    display: block;
    padding: 0;
    margin: 0 0 .5rem;
    font-size: .9375rem;
    line-height: 1.4;
}

.acs-field-label,
.acs-terms-prompt {
    color: var(--acs-pricing-ink);
}

.acs-field-prompt {
    color: var(--acs-pricing-muted);
}

.acs-field-input-wrapper {
    position: relative;
    max-width: 25rem;
}

.acs-field-input-wrapper::before {
    position: absolute;
    inset-inline-start: .875rem;
    top: 1rem;
    width: 1rem;
    height: 1rem;
    content: '';
    pointer-events: none;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23424242' stroke-width='1.8' stroke-linecap='round'%3E%3Ccircle cx='10.5' cy='10.5' r='6.5'/%3E%3Cpath d='m16 16 4 4'/%3E%3C/svg%3E");
}

.acs-pricing-calculator-wrapper .acs-typeahead-input {
    box-sizing: border-box;
    width: 100%;
    height: 3rem;
    padding: 0 5rem 0 2.375rem;
    border: 1px solid var(--acs-pricing-border);
    border-radius: .5rem;
    background: #fff;
    color: var(--acs-pricing-ink);
    font: inherit;
    font-size: .9375rem;
}

.acs-pricing-calculator-wrapper :is(.acs-typeahead-input, .acs-typeahead-clear, .acs-typeahead-toggle, .acs-btn, .acs-pricing-options):focus-visible {
    outline: 2px solid var(--acs-pricing-accent);
    outline-offset: 2px;
}

.acs-typeahead-clear,
.acs-typeahead-toggle {
    position: absolute;
    top: .25rem;
    inset-inline-end: .25rem;
    display: grid;
    place-items: center;
    width: 2.5rem;
    height: 2.5rem;
    border: 0;
    border-radius: .375rem;
    padding: 0;
    background: transparent;
    color: var(--acs-pricing-muted);
    cursor: pointer;
}

.acs-typeahead-clear {
    inset-inline-end: 2.75rem;
}

.acs-typeahead-clear:hover,
.acs-typeahead-toggle:hover {
    background-color: var(--color-neutral-100, #f5f5f5);
}

.acs-typeahead-clear::before,
.acs-typeahead-clear::after {
    content: '';
    grid-area: 1 / 1;
    width: .625rem;
    height: 1px;
    background: currentColor;
    rotate: 45deg;
}

.acs-typeahead-clear::after {
    rotate: -45deg;
}

.acs-typeahead-toggle::before {
    content: '';
    width: .45rem;
    height: .45rem;
    border-right: 1px solid currentColor;
    border-bottom: 1px solid currentColor;
    rotate: 45deg;
    translate: 0 -.125rem;
}

.acs-typeahead-toggle[aria-expanded="true"]::before {
    rotate: 225deg;
    translate: 0 .125rem;
}

.acs-typeahead-results {
    position: absolute;
    z-index: 10;
    inset: calc(100% + .25rem) 0 auto;
    display: none;
    max-height: 15rem;
    overflow: auto;
    padding: .375rem;
    border: 1px solid var(--acs-pricing-border);
    border-radius: 1rem;
    background: #fff;
    box-shadow: var(--shadow-sm, 0 2px 4px rgba(0, 0, 0, .12));
}

.acs-typeahead-results.active {
    display: block;
}

.acs-typeahead-result-item,
.acs-typeahead-status {
    display: block;
    width: 100%;
    padding: .625rem .75rem;
    border: 0;
    border-radius: .375rem;
    background: transparent;
    font: inherit;
    font-size: .875rem;
    text-align: start;
    overflow-wrap: anywhere;
}

.acs-typeahead-result-item {
    color: var(--acs-pricing-ink);
    cursor: pointer;
}

.acs-typeahead-result-item:hover,
.acs-typeahead-result-item:focus-visible {
    background: var(--acs-pricing-note);
}

.acs-typeahead-result-item strong,
.acs-typeahead-result-item small {
    display: block;
}

.acs-typeahead-result-item small {
    color: var(--acs-pricing-muted);
}

.acs-radio-group {
    display: grid;
    gap: .375rem;
}

.acs-radio-label,
.acs-terms-consent {
    display: flex;
    align-items: flex-start;
    gap: .5rem;
    cursor: pointer;
}

.acs-radio-label input,
.acs-terms-consent input {
    flex: none;
    margin: .2em 0 0;
    accent-color: var(--acs-pricing-accent);
}

.acs-terms-consent,
.acs-field-error,
.acs-pricing-agreement-note,
.acs-subscriber-discount-note,
.acs-disclaimer,
.acs-waiver-info {
    font-size: .875rem;
}

.acs-field-error:not(:empty) {
    margin-top: .375rem;
    color: var(--acs-pricing-error);
}

.acs-field-error:not(:empty)::before {
    content: '';
    display: inline-block;
    width: .75rem;
    height: .75rem;
    margin-inline-end: .375rem;
    background: currentColor;
    mask: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='6.75' fill='none' stroke='black' stroke-width='1.5'/%3E%3Cpath d='M8 4.5v4' stroke='black' stroke-width='1.5' stroke-linecap='round'/%3E%3Ccircle cx='8' cy='11.25' r='.85'/%3E%3C/svg%3E");
    vertical-align: -.075em;
}

.acs-form-field:has(.acs-field-error:not(:empty)) .acs-field-label,
.acs-help-note:has(.acs-field-error:not(:empty)) .acs-terms-prompt {
    color: var(--acs-pricing-error);
}

.acs-pricing-calculator-wrapper .acs-typeahead-input[aria-invalid="true"] {
    border-color: var(--acs-pricing-error);
}

.acs-ux-note,
.acs-special-conditions,
.acs-waiver-info {
    position: relative;
    border-radius: 1rem;
    padding: .875rem 1rem .875rem 2.625rem;
    background: var(--acs-pricing-note);
}

.acs-ux-note::before,
.acs-special-conditions::before,
.acs-waiver-info::before {
    position: absolute;
    content: '';
    inset-inline-start: 1rem;
    top: .98rem;
    width: 1rem;
    height: 1rem;
    background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Ccircle cx='8' cy='8' r='8' fill='%23412bfd'/%3E%3Cpath d='M8 7v4m0-6h.01' fill='none' stroke='white' stroke-width='1.5' stroke-linecap='round'/%3E%3C/svg%3E");
}

.acs-special-conditions h3,
.acs-special-conditions ul,
.acs-disclaimer p,
.acs-subscriber-discount-note p,
.acs-waiver-info p,
.acs-embargo-message p,
.acs-error-message p {
    margin: 0;
}

.acs-special-conditions ul {
    padding: 0;
    list-style: none;
}

.acs-special-conditions:has(li:only-child) {
    display: flex;
    flex-wrap: wrap;
    gap: .125rem .375rem;
}

.acs-embargo-message,
.acs-error-message {
    padding: .875rem 1rem;
    border: 1px solid var(--color-red-300, #f27f77);
    border-radius: 1rem;
    background: var(--color-red-100, #fdecec);
    color: var(--acs-pricing-error);
}

.acs-form-buttons,
.acs-results-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .75rem;
}

.acs-pricing-calculator-wrapper .acs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: .5rem;
    min-height: 2.75rem;
    border: 1px solid transparent;
    border-radius: 99rem;
    padding: .625rem 1.25rem;
    font: inherit;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.acs-pricing-calculator-wrapper .acs-btn-primary {
    background: var(--acs-pricing-ink);
    color: #fff;
}

.acs-pricing-calculator-wrapper .acs-btn-primary:hover {
    background: var(--color-neutral-1000, #424242);
}

.acs-pricing-calculator-wrapper .acs-btn-outline {
    border-color: var(--acs-pricing-accent);
    background: #fff;
    color: var(--acs-pricing-accent-ink);
}

.acs-pricing-calculator-wrapper .acs-btn-outline:hover {
    background: var(--acs-pricing-note);
}

.acs-pricing-calculator-wrapper .acs-btn:disabled {
    opacity: .6;
    cursor: wait;
}

.acs-pricing-calculator-wrapper .acs-btn[aria-busy="true"] {
    opacity: 1;
}

.acs-btn[aria-busy="true"]::after {
    width: .875rem;
    height: .875rem;
    border: 2px solid currentColor;
    border-inline-end-color: transparent;
    border-radius: 50%;
    content: '';
    animation: acs-pricing-spin .8s linear infinite;
}

@keyframes acs-pricing-spin {
    to { transform: rotate(360deg); }
}

@media (prefers-reduced-motion: reduce) {
    .acs-btn[aria-busy="true"]::after {
        animation: none;
    }
}

.acs-pricing-options {
    max-width: 100%;
    overflow: auto;
}

.acs-pricing-table {
    width: 100%;
    min-width: 36rem;
    border-collapse: collapse;
    font-size: .875rem;
}

.acs-pricing-table th,
.acs-pricing-table td {
    padding: .75rem;
    border: 1px solid var(--acs-pricing-border);
    text-align: start;
    vertical-align: top;
}

.acs-pricing-table thead {
    background: var(--color-neutral-50, #fafafa);
}

.acs-pricing-table thead th:last-child,
.acs-pricing-table .acs-option-price {
    text-align: end;
}

.acs-option-category {
    width: 19%;
}

.acs-pricing-table .acs-option-category,
.acs-pricing-table .acs-option-type {
    font-weight: 400;
}

.acs-final-published-row {
    background: var(--color-vanadium-yellow-100, #fff9e6);
}

.acs-accepted-manuscript-row {
    background: var(--color-nickel-green-50, #f4fae3);
}

.acs-pricing-table .lic-note,
.acs-discount-notes {
    display: block;
    margin-top: .375rem;
    color: var(--acs-pricing-muted);
}

@media (min-width: 48rem) {
    .acs-pricing-form-container,
    .acs-pricing-results-container {
        border-radius: 3rem;
    }
}
