/*
 * Everything visual beyond this file comes from the renderer's own stylesheet,
 * which it injects at runtime. Keep this small and limited to the page shell:
 * anything that fights the renderer's styles will break on its next upgrade.
 */

body {
    margin: 0;
}

.boot {
    font: 13px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace;
    padding: 2rem;
    color: #5b6270;
    white-space: pre-wrap;
}

/*
 * The one exception to the rule above, and it earns it.
 *
 * The renderer lays a tag section out in two columns, reserving the right one
 * for supporting cards. A guide is a tag with no operations, so its right
 * column renders empty while the prose is squeezed into half the width — at
 * which point a status-code table wraps its header one character per line
 * ("St / at / us"). That is the difference between a readable guide and an
 * unreadable one.
 *
 * The rule fires only when the right column has no content of its own, so a
 * resource's tag section — which does use it — is left alone, and so is every
 * operation section (those are not inside `.tag-section-container` at all).
 * `!important` is needed because the renderer injects its stylesheet at
 * runtime, after this file has already been applied.
 */
.tag-section-container
    .section-columns:not(:has(.section-column:last-child > *)) {
    display: block !important;
}

/*
 * Hide the renderer's "Powered by Scalar" links — one in the sidebar footer,
 * one repeated in every section.
 *
 * The renderer is MIT licensed, which requires its copyright and licence notice
 * to travel with the code, not to appear in the interface. That notice is
 * intact: the bundle is copied into the build byte for byte, header comment and
 * all, and the dependency is declared in package.json.
 *
 * Matched by destination rather than by class name, because the two links share
 * no class and class names are minified on the renderer's next release. This
 * deliberately leaves scalar.com's terms and privacy links alone — those appear
 * next to the AI feature and are a legal notice about a third-party service,
 * not branding.
 */
a[href="https://www.scalar.com"]
{
    display: none !important;
}

/*
 * The HoneyBook wordmark, above the sidebar's search button — a real `<a>`
 * (inserted by index.html once the renderer mounts, since a pseudo-element
 * can't carry a link) rather than a `::before`, so the logo can navigate home.
 * `flex-shrink: 0` keeps a short viewport from squeezing the box and clipping
 * the background image inside it.
 */
.hb-logo--wordmark {
    display: block;
    flex-shrink: 0;
    width: 158px; /* native size of the SVG (viewBox 0 0 158 14) */
    height: 14px;
    margin: 16px 16px 4px;
    background-image: url('./honeybook-api-logo.svg');
    background-repeat: no-repeat;
    background-position: left center;
    background-size: auto;
}

/* Artwork is white-on-transparent, made for the dark sidebar; invert for light. */
body.light-mode .hb-logo--wordmark {
    filter: invert(1);
}

/*
 * The HoneyBook monogram, left of the mobile header's hamburger button. Same
 * real-`<a>` reasoning as the wordmark above.
 */
.hb-logo--monogram {
    display: block;
    width: 22px; /* native size of the SVG (viewBox 0 0 22 22) */
    height: 22px;
    margin-left: 4px;
    background-image: url('./honeybook-monogram-logo.svg');
    background-repeat: no-repeat;
    background-position: center;
    background-size: auto;
}

body.light-mode .hb-logo--monogram {
    filter: invert(1);
}

/*
 * The Request Access form, which the renderer does not style; every color
 * comes from its theme variables so light and dark mode both follow it.
 */
.request-access-form {
    display: grid;
    gap: 20px;
    max-width: 760px;
    margin-top: 24px;
    padding: 32px;
    border: 1px solid var(--scalar-border-color);
    border-radius: var(--scalar-radius-lg);
    background: var(--scalar-background-1);
    color: var(--scalar-color-1);
    font-family: var(--scalar-font);
}

.request-access-form__grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.request-access-form__field {
    display: grid;
    gap: 8px;
}

.request-access-form__label {
    font-weight: 500;
}

.request-access-form__input {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 14px;
    border: 1px solid var(--scalar-border-color);
    border-radius: var(--scalar-radius);
    background: var(--scalar-background-2);
    color: var(--scalar-color-1);
    font: inherit;
}

textarea.request-access-form__input {
    min-height: 120px;
    resize: vertical;
}

.request-access-form__input:focus-visible {
    outline: 2px solid var(--scalar-color-accent);
    outline-offset: 1px;
}

.request-access-form__input[aria-invalid='true'] {
    border-color: var(--scalar-color-red);
}

.request-access-form__registration {
    display: grid;
    gap: 20px;
    min-width: 0;
    margin: 0;
    padding: 24px 0 0;
    border: none;
    border-top: 1px solid var(--scalar-border-color);
}

/*
 * A floated legend stops being drawn inside the fieldset's border and becomes
 * an ordinary grid item, so it takes the same gap as the fields below it.
 */
.request-access-form__registration > legend {
    float: left;
    width: 100%;
    padding: 0;
}

.request-access-form__registration-title {
    font-size: 1.15em;
    font-weight: 600;
}

.request-access-form__scopes-picker {
    display: grid;
    gap: 10px;
}

.request-access-form__scopes-control {
    position: relative;
}

.request-access-form__scopes-trigger {
    display: flex;
    gap: 12px;
    align-items: center;
    justify-content: space-between;
    text-align: left;
    cursor: pointer;
}

/* Drawn with borders rather than a glyph, so it stays out of the trigger's accessible name. */
.request-access-form__scopes-trigger::after {
    content: '';
    flex-shrink: 0;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border-right: 2px solid var(--scalar-color-2);
    border-bottom: 2px solid var(--scalar-color-2);
    transform: rotate(45deg);
}

.request-access-form__scopes-trigger[aria-expanded='true']::after {
    margin-top: 4px;
    transform: rotate(225deg);
}

.request-access-form__scopes-trigger:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.request-access-form__scopes-listbox {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    z-index: 10;
    box-sizing: border-box;
    max-height: min(320px, 60vh);
    overflow-y: auto;
    padding: 4px;
    border: 1px solid var(--scalar-border-color);
    border-radius: var(--scalar-radius);
    background: var(--scalar-background-1);
    box-shadow: var(--scalar-shadow-2);
}

.request-access-form__scope-option {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 8px 10px;
    border-radius: var(--scalar-radius);
    overflow-wrap: anywhere;
    cursor: pointer;
}

.request-access-form__scope-option:hover,
.request-access-form__scope-option:focus-visible {
    background: var(--scalar-background-2);
}

.request-access-form__scope-option:focus-visible {
    outline: 2px solid var(--scalar-color-accent);
    outline-offset: -2px;
}

.request-access-form__scope-checkmark {
    position: relative;
    flex-shrink: 0;
    box-sizing: border-box;
    width: 16px;
    height: 16px;
    margin-top: 2px;
    border: 1px solid var(--scalar-color-3);
    border-radius: 4px;
}

.request-access-form__scope-option[aria-selected='true']
    .request-access-form__scope-checkmark {
    border-color: var(--scalar-color-accent);
    background: var(--scalar-color-accent);
}

.request-access-form__scope-option[aria-selected='true']
    .request-access-form__scope-checkmark::after {
    content: '';
    position: absolute;
    top: 1px;
    left: 4px;
    width: 4px;
    height: 8px;
    border-right: 2px solid var(--scalar-background-1);
    border-bottom: 2px solid var(--scalar-background-1);
    transform: rotate(45deg);
}

.request-access-form__scope-text {
    display: grid;
    gap: 2px;
}

.request-access-form__scope-text code {
    justify-self: start;
}

.request-access-form__terms {
    display: flex;
    gap: 12px;
    align-items: center;
    padding: 16px 20px;
    border-radius: var(--scalar-radius-lg);
    background: var(--scalar-background-2);
    color: var(--scalar-color-2);
}

.request-access-form__submit {
    justify-self: start;
    padding: 12px 32px;
    border: none;
    border-radius: 999px;
    background: var(--scalar-button-1);
    color: var(--scalar-button-1-color);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.request-access-form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* After the layout rules above, so it overrides them on narrow screens. */
@media (max-width: 640px) {
    .request-access-form__grid {
        grid-template-columns: 1fr;
    }

    .request-access-form {
        padding: 20px;
    }
}

/*
 * Scalar's markdown styles outrank a single class; scoping under the mount
 * point wins without naming Scalar's internals.
 */
#request-access-form .request-access-form__error {
    margin: 0;
    color: var(--scalar-color-red);
    font-size: 0.9em;
}

#request-access-form .request-access-form__hint {
    margin: 0;
    color: var(--scalar-color-2);
    font-size: 0.9em;
}

#request-access-form .request-access-form__scope-description {
    color: var(--scalar-color-2);
    font-size: 0.9em;
}

#request-access-form .request-access-form__scope-chips {
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
}

#request-access-form .request-access-form__scope-chips[hidden] {
    display: none;
}

#request-access-form .request-access-form__scope-chip {
    display: inline-flex;
    gap: 4px;
    align-items: center;
    min-width: 0;
    margin: 0;
    padding: 2px 4px 2px 10px;
    list-style: none;
    border: 1px solid var(--scalar-border-color);
    border-radius: 999px;
    background: var(--scalar-background-2);
    color: var(--scalar-color-1);
    overflow-wrap: anywhere;
}

#request-access-form .request-access-form__scope-chip-remove {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: transparent;
    color: var(--scalar-color-2);
    font: inherit;
    line-height: 1;
    cursor: pointer;
}

#request-access-form .request-access-form__scope-chip-remove:hover {
    background: var(--scalar-background-3);
    color: var(--scalar-color-1);
}

#request-access-form .request-access-form__scope-chip-remove:focus-visible {
    outline: 2px solid var(--scalar-color-accent);
}

#request-access-form .request-access-form__scope-chip-remove:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

#request-access-form .request-access-form__terms a {
    color: var(--scalar-color-accent);
}

#request-access-form .request-access-form__status {
    margin: 0;
    color: var(--scalar-color-red);
}

#request-access-form .request-access-form__status a {
    color: var(--scalar-color-accent);
}

#request-access-form .request-access-form__success {
    max-width: 760px;
    margin-top: 24px;
    padding: 32px;
    border: 1px solid var(--scalar-border-color);
    border-radius: var(--scalar-radius-lg);
    background: var(--scalar-background-1);
    color: var(--scalar-color-green);
}
