input,
textarea,
button {
    font-family: Lato, sans-serif;
    margin: 0;
    outline-width: 0;
}

textarea {
    padding: 2px;
}

input[type="text"]:not(.fw-inline),
input[type="password"]:not(.fw-inline),
input[type="search"]:not(.fw-inline),
input[type="email"]:not(.fw-inline),
input[type="number"]:not(.fw-inline),
textarea {
    box-sizing: border-box;
    width: 100%;
    height: 40px;
    padding: 0 10px;
    font-size: 14px;
    line-height: 1.33em;
    box-shadow: none;
    border-radius: 0;
    margin: 5px 0;
    color: var(--cs-white-text);
    background-color: var(--input-background-color);
    border: 0 none;
    border-bottom: 1px solid var(--input-border-color);
}

input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
textarea:focus {
    background-color: var(--input-focus-background-color);
}

.fw-dialog input[type="text"]:not(.fw-inline),
.fw-dialog input[type="password"]:not(.fw-inline),
.fw-dialog input[type="search"]:not(.fw-inline),
.fw-dialog input[type="email"]:not(.fw-inline),
.fw-dialog input[type="number"]:not(.fw-inline),
.fw-dialog textarea,
.fw-dialog div[contenteditable="true"],
.fw-dialog select,
.fw-dialog .fw-entry-field select {
    border: 1px solid var(--input-dialog-border-color);
}
.fw-entry-field .ProseMirror {
    border: 1px solid var(--input-border-color);
    border-radius: 4px;
    min-height: 2.5rem;
    padding: 0.25rem;
    background: var(--input-background-color);
}

/**
 * Checkbox
 */
.fw-check {
    position: absolute;
    opacity: 0;
}

.fw-check + label {
    position: relative;
    display: block;
    margin: 0;
    padding: 0;
}

.fw-check + label::before {
    content: "";
    position: relative;
    display: block;
    width: 13px;
    height: 13px;
    border: 1px solid var(--overview-checkbox-border);
    border-radius: 2px;
    background: linear-gradient(
        to bottom,
        rgb(var(--overview-checkbox-background-color-from)) 0%,
        rgb(var(--overview-checkbox-background-color-to)) 100%
    );
}

.fw-check:checked + label::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    display: block;
    width: 3px;
    height: 7px;
    border-bottom: 2px solid var(--overview-checkbox-color);
    border-right: 2px solid var(--overview-checkbox-color);
    transform: rotate(45deg);
}

.fw-label-check + label {
    line-height: 15px;
}

.fw-label-check + label::before {
    display: inline-block;
    vertical-align: top;
    margin-right: 6px;
}

/*
 * checkbox in a fw-button
 */
.fw-button input[type="checkbox"] {
    margin-right: 3px;
}

/* -----------------------------------------------------------------
 * Override: remove the default border-bottom on form inputs
 * ----------------------------------------------------------------- */
input[type="text"]:not(.fw-inline),
input[type="password"]:not(.fw-inline),
input[type="search"]:not(.fw-inline),
input[type="email"]:not(.fw-inline),
input[type="number"]:not(.fw-inline),
textarea {
    border-bottom: 0 none;
}

/* -----------------------------------------------------------------
 * Category form — narrow inline input next to an add button
 * ----------------------------------------------------------------- */
input[type="text"].category-form {
    width: calc(100% - 38px);
    display: inline-block;
    vertical-align: middle;
}

/* -----------------------------------------------------------------
 * Focus states — extend the base rules with :focus-within support
 * ----------------------------------------------------------------- */
input[type="text"]:focus,
input[type="number"]:focus,
input[type="password"]:focus,
input[type="search"]:focus,
input[type="email"]:focus,
div.fw-input:focus-within,
textarea:focus {
    background-color: var(--input-focus-background-color);
}

/* -----------------------------------------------------------------
 * Select containers
 * ----------------------------------------------------------------- */
.fw-select-container select {
    display: inline-block;
    width: calc(100% - 22px);
    appearance: none;
    cursor: pointer;
}

.fw-select-container select option.fw-placeholder {
    display: none;
}

.fw-select-container {
    margin-bottom: 18px;
    position: relative;
}

.fw-select-container .fw-select-arrow {
    position: absolute;
    top: 14px;
    right: 16px;
    pointer-events: none;
}

/* -----------------------------------------------------------------
 * Entry field widths (ProseMirror inputs, selects)
 * ----------------------------------------------------------------- */
.fw-entry-field .ProseMirror,
.fw-entry-field input[type="text"],
.fw-entry-field input[type="number"] {
    width: 686px;
    max-width: 80vw;
}

.fw-entry-field select {
    padding: 0 3px 0 13px;
    border: 0 none;
    color: var(--cs-light-text);
    background-color: var(--select-background-color);
    height: 38px;
    width: 561px;
    appearance: none;
    cursor: pointer;
    display: inline-block;
}

.fw-entry-field select.fw-large {
    width: 664px;
}

/* -----------------------------------------------------------------
 * Form label
 * ----------------------------------------------------------------- */
.form-label {
    font-size: 11px;
    font-weight: bold;
    margin-bottom: 5px;
}

/* -----------------------------------------------------------------
 * Name input fields (first name / last name pairs)
 * ----------------------------------------------------------------- */
.fw-name-input {
    width: 226px;
}

.fw-name-input.fw-first {
    margin-right: 23px;
}

/* -----------------------------------------------------------------
 * Checkable table rows (app-specific positioning; base styles in
 * fwtoolkit/css/checkable_list.css)
 * ----------------------------------------------------------------- */
.fw-checkable-td,
.fw-checkable > td {
    position: relative;
}

.fw-checkable-td.fw-checked::after,
tr.fw-checkable.fw-checked > td:last-child::after {
    top: 17px;
}

/* -----------------------------------------------------------------
 * Addable input list
 * ----------------------------------------------------------------- */
.fw-add-input {
    cursor: pointer;
    margin-left: 14px;
}

.fw-add-input::before {
    width: 0.7em;
}

.fw-list-input {
    margin-top: 7px;
}

.fw-list-input:first-child {
    margin-top: 0;
}

/* -----------------------------------------------------------------
 * Form error
 * ----------------------------------------------------------------- */
.fw-fomt-error {
    color: #ff0000;
}

/* -----------------------------------------------------------------
 * AJAX file uploader
 * ----------------------------------------------------------------- */
.ajax-upload input[type="file"] {
    display: none;
}

.ajax-upload-label {
    margin-left: 10px;
}

/* -----------------------------------------------------------------
 * Radio buttons
 * ----------------------------------------------------------------- */
.fw-radio input[type="radio"] {
    display: inline-block;
    width: 40px;
    margin-bottom: 20px;
}

/* -----------------------------------------------------------------
 * Type-switch field-part sizing overrides
 * (Base type-switch styles are in fwtoolkit/css/type_switch.css)
 * ----------------------------------------------------------------- */
.fw-type-switch-input-inner .field-part {
    display: inline-block;
    margin-right: 5px;
}

.fw-type-switch-input-inner .field-part:last-child {
    margin-right: 0;
}

.field-part-short .ProseMirror {
    width: 64px;
}

.fw-type-switch-input-inner .field-part-huge input,
.fw-type-switch-input-inner .field-part-huge .ProseMirror {
    width: 250px;
}

.fw-type-switch-input-inner .field-part-long input,
.fw-type-switch-input-inner .field-part-long .ProseMirror {
    width: 130px;
}

.fw-type-switch-input-inner .field-part-single {
    width: 100% !important;
}

.fw-type-switch-input-inner .field-part-single .ProseMirror {
    width: 100%;
}

/* -----------------------------------------------------------------
 * Dialog table header cell sizing
 * ----------------------------------------------------------------- */
.fw-dialog-table th {
    vertical-align: top;
    padding: 0 6px 0 8px;
    width: 164px;
}

/* -----------------------------------------------------------------
 * List input wrapper — add/remove buttons
 * ----------------------------------------------------------------- */
.list-input-wrapper .add-remove-list {
    display: inline-block;
    cursor: pointer;
    margin-left: 14px;
}

.list-input-wrapper .add-remove-list::before {
    content: "\2796";
    width: 0.7em;
}

.list-input-wrapper:last-child .add-remove-list::before {
    content: "\2795";
}

/* -----------------------------------------------------------------
 * Responsive breakpoints
 * ----------------------------------------------------------------- */
@media screen and (width <= 740px) {
    .fw-entry-field .ProseMirror,
    .fw-entry-field input[type="text"],
    .fw-entry-field input[type="number"] {
        max-width: 70vw;
    }

    .fw-type-switch-input-wrapper {
        max-width: 70vw;
    }

    .tokenfield {
        max-width: 70vw;
    }
}

@media screen and (width <= 560px) {
    .fw-entry-field .ProseMirror,
    .fw-entry-field input[type="text"],
    .fw-entry-field input[type="number"] {
        max-width: 50vw;
    }

    .fw-type-switch-input-wrapper {
        max-width: 50vw;
    }

    .tokenfield {
        max-width: 50vw;
    }

    .fw-type-switch {
        display: block;
        margin-bottom: 5px;
    }

    .fw-type-switch-input-inner {
        width: auto;
    }
}

@media screen and (width <= 460px) {
    .fw-entry-field .ProseMirror,
    .fw-entry-field input[type="text"],
    .fw-entry-field input[type="number"] {
        max-width: 40vw;
    }

    .fw-type-switch-input-wrapper {
        max-width: 40vw;
    }

    .tokenfield {
        max-width: 40vw;
    }

    .fw-dialog-table th {
        width: 140px;
    }

    .fw-tabs-panel {
        overflow-x: hidden;
    }
}
