/*
 * Shape: how rounded things are, in one place.
 *
 * Every layout loads this file (the admin, and the login, forgot-password and reset-password
 * pages, which do not load theme.css), so a button or a field has the same corners wherever it
 * appears. Before this, the shapes lived in two files and were only right because theme.css
 * happened to load after style.css: the guest pages, which have no theme.css, got a 25px pill
 * on a button and a different radius on every field.
 *
 * The rule of thumb:
 *
 *   --rt-radius          3px   what you type into or press: fields, buttons, dropdowns
 *   --rt-radius-md       8px   small surfaces you tap: icon buttons, pagination, menu items
 *   --rt-radius-nested  10px   a card inside a card, and section heading bars
 *   --rt-card-radius    14px   the surfaces themselves: cards, panels
 *   --rt-radius-pill   999px   labels, counts and tabs that describe or switch a view, and
 *                              never a button or a field
 *
 * Pages with a design of their own (the dashboard, the 3D studios, the project builder) carry
 * their own tokens and are left to it; this governs the shared controls they are built from.
 * A new radius should be one of these, not a number.
 */

:root {
    --rt-radius: 3px;
    --rt-radius-md: 8px;
    --rt-radius-nested: 10px;
    --rt-card-radius: 14px;
    --rt-radius-pill: 999px;
}

/* ----- What you type into or press ----- */

.btn {
    border-radius: var(--rt-radius) !important;
}

.btn.btn-icon {
    border-radius: var(--rt-radius-md) !important;
}

.form-control,
.form-control.form-control-solid,
.form-control.form-control-lg,
.form-control.form-control-solid.form-control-lg {
    border-radius: var(--rt-radius);
}

/* The addon at the end of an input group closes it with the same corners as the field. */
.input-group > .input-group-append > .btn,
.input-group > .input-group-append > .input-group-text,
.input-group > .input-group-prepend:not(:first-child) > .btn,
.input-group > .input-group-prepend:not(:first-child) > .input-group-text,
.input-group > .input-group-prepend:first-child > .btn:not(:first-child),
.input-group > .input-group-prepend:first-child > .input-group-text:not(:first-child) {
    border-top-right-radius: var(--rt-radius);
    border-bottom-right-radius: var(--rt-radius);
}

/* ----- Surfaces ----- */

.card.card-custom,
.card {
    border-radius: var(--rt-card-radius);
}

/* Accordions and nested cards sit inside their card, a step tighter. Below the rule above,
   so it wins between two selectors of the same weight. */
.accordion > .card,
.card .card {
    border-radius: var(--rt-radius-nested);
}

/* A section bar. It is forced, because pages put this class on all sorts of elements. */
.common-for-border-radius {
    border-radius: var(--rt-radius-nested) !important;
}

/* ----- Labels and tabs ----- */

.nav.nav-pills .show > .nav-link,
.nav.nav-pills .nav-link.active {
    border-radius: var(--rt-radius-pill);
}
