/* Creating the shared UI tokens */
:root {
    --ui-color-brand: rgb(247, 198, 47);
    --ui-color-brand-dark: rgb(207, 169, 55);
    --ui-color-canvas: rgb(57, 61, 65);
    --ui-color-surface: rgb(65, 70, 75);
    --ui-color-surface-strong: rgb(48, 52, 56);
    --ui-color-border: rgb(82, 88, 94);
    --ui-color-text: rgb(227, 231, 235);
    --ui-color-muted: rgb(158, 167, 176);
    --ui-color-success: rgb(77, 177, 77);
    --ui-color-danger: rgb(224, 99, 99);
    --ui-color-info: rgb(104, 168, 217);
    --ui-radius-small: 3px;
    --ui-radius-medium: 10px;
    --ui-radius-large: 17px;
    --ui-shadow-focus: 0 0 0 3px rgba(247, 198, 47, 0.28);
    --ui-transition-fast: 0.2s ease;
}

/* Normalizing the reusable UI component box model */
[class^="Ui"],
[class*=" Ui"],
[class^="Ui"]::before,
[class^="Ui"]::after,
[class*=" Ui"]::before,
[class*=" Ui"]::after {
    box-sizing: border-box;
}

/* Styling the shared eyebrow label */
.UiEyebrow {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;

    color: var(--ui-color-brand);
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* Styling the shared button */
.UiButton {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 9px;

    background: transparent;
    border: 1px solid transparent;
    border-radius: var(--ui-radius-small);

    min-height: 50px;
    padding: 13px 22px;

    color: var(--ui-color-text);
    font-size: 16px;
    font-weight: 700;
    line-height: 1.25;
    text-align: center;
    white-space: nowrap;

    cursor: pointer;
    transition: background var(--ui-transition-fast), border-color var(--ui-transition-fast), color var(--ui-transition-fast), box-shadow var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.UiButton:hover {
    color: var(--ui-color-text);
    transform: translateY(-1px);
}

.UiButton:focus-visible {
    box-shadow: var(--ui-shadow-focus);
    outline: none;
}

.UiButton:active {
    transform: translateY(0);
}

.UiButton:disabled,
.UiButton[aria-disabled="true"] {
    opacity: 0.42;
    cursor: not-allowed;
    filter: none;
    transform: none;
}

.UiButton > i {
    margin: 0;
    font-size: 14px;
}

.UiButton--Primary {
    background: linear-gradient(225deg, var(--ui-color-brand), var(--ui-color-brand-dark));
    color: rgb(56, 58, 60);
}

.UiButton--Primary:hover {
    box-shadow: 0 10px 28px rgba(247, 198, 47, 0.2);
    color: rgb(43, 45, 47);
}

.UiButton--Secondary {
    background: rgb(239, 241, 243);
    color: rgb(57, 61, 65);
}

.UiButton--Secondary:hover {
    background: rgb(255, 255, 255);
    color: rgb(37, 40, 43);
}

.UiButton--Ghost {
    border-color: var(--ui-color-border);
    color: var(--ui-color-brand);
}

.UiButton--Ghost:hover {
    background: rgba(247, 198, 47, 0.07);
    border-color: rgba(247, 198, 47, 0.5);
    color: var(--ui-color-brand);
}

.UiButton--Danger {
    background: rgba(224, 99, 99, 0.08);
    border-color: rgba(224, 99, 99, 0.38);
    color: rgb(244, 158, 158);
}

.UiButton--Danger:hover {
    background: rgba(224, 99, 99, 0.15);
    border-color: rgba(224, 99, 99, 0.65);
    color: rgb(255, 184, 184);
}

.UiButton--Small {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 13px;
}

.UiButton--Large {
    min-height: 58px;
    padding: 17px 28px;
    font-size: 18px;
}

.UiButton--Full {
    width: 100%;
}

/* Styling the shared icon button */
.UiIconButton {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;

    background: var(--ui-color-surface-strong);
    border: 1px solid var(--ui-color-border);
    border-radius: 50%;

    width: 50px;
    height: 50px;
    min-width: 50px;
    min-height: 50px;

    color: var(--ui-color-brand);
    font-size: 17px;

    cursor: pointer;
    transition: background var(--ui-transition-fast), border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

.UiIconButton:hover {
    background: rgb(56, 60, 64);
    border-color: rgba(247, 198, 47, 0.45);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
}

.UiIconButton:focus-visible {
    box-shadow: var(--ui-shadow-focus);
    outline: none;
}

.UiIconButton--Small {
    width: 38px;
    height: 38px;
    min-width: 38px;
    min-height: 38px;
    font-size: 14px;
}

/* Styling the shared card */
.UiCard {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    background: linear-gradient(145deg, rgba(72, 77, 82, 0.95), rgba(59, 63, 67, 0.96));
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-medium);

    position: relative;

    min-width: 0;
    padding: 26px;
    overflow: hidden;
}

.UiCard--Accent {
    border-color: rgba(247, 198, 47, 0.42);
}

.UiCard--Accent::after {
    content: '';

    background: var(--ui-color-brand);
    border-radius: 50%;
    filter: blur(48px);
    opacity: 0.12;

    position: absolute;
    right: -45px;
    bottom: -45px;

    width: 120px;
    height: 120px;
}

.UiCard > i {
    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(247, 198, 47, 0.1);
    border: 1px solid rgba(247, 198, 47, 0.18);
    border-radius: 50%;

    width: 44px;
    height: 44px;
    margin-bottom: 22px;

    color: var(--ui-color-brand);
    font-size: 18px;
}

.UiCard__Kicker {
    margin-bottom: 7px;
    color: var(--ui-color-muted);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.UiCard h3 {
    margin-bottom: 10px;
    font-size: 19px;
}

.UiCard p {
    margin: 0;
    color: var(--ui-color-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* Styling the shared badge */
.UiBadge {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 7px;

    border: 1px solid transparent;
    border-radius: 100px;

    width: max-content;
    padding: 6px 10px;

    font-size: 12px;
    font-weight: 700;
    line-height: 1.2;
}

.UiBadge--Success {
    background: rgba(77, 177, 77, 0.1);
    border-color: rgba(77, 177, 77, 0.28);
    color: rgb(140, 215, 140);
}

.UiBadge--Warning {
    background: rgba(247, 198, 47, 0.1);
    border-color: rgba(247, 198, 47, 0.28);
    color: rgb(247, 211, 102);
}

.UiBadge--Danger {
    background: rgba(224, 99, 99, 0.1);
    border-color: rgba(224, 99, 99, 0.28);
    color: rgb(244, 158, 158);
}

.UiBadge--Neutral {
    background: rgba(158, 167, 176, 0.1);
    border-color: rgba(158, 167, 176, 0.22);
    color: rgb(190, 198, 205);
}

/* Styling the shared alert */
.UiAlert {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 13px;

    background: rgba(104, 168, 217, 0.08);
    border: 1px solid rgba(104, 168, 217, 0.24);
    border-radius: var(--ui-radius-medium);

    width: 100%;
    padding: 16px;
}

.UiAlert > i {
    margin-top: 2px;
    color: rgb(136, 190, 231);
    font-size: 17px;
}

.UiAlert > div {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
}

.UiAlert strong {
    font-size: 14px;
}

.UiAlert span {
    color: var(--ui-color-muted);
    font-size: 13px;
    line-height: 1.5;
}

.UiAlert--Success {
    background: rgba(77, 177, 77, 0.08);
    border-color: rgba(77, 177, 77, 0.24);
}

.UiAlert--Success > i {
    color: rgb(126, 205, 126);
}

.UiAlert--Danger {
    background: rgba(224, 99, 99, 0.08);
    border-color: rgba(224, 99, 99, 0.24);
}

.UiAlert--Danger > i {
    color: rgb(244, 158, 158);
}

/* Styling the shared form field */
.UiField {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;

    width: 100%;
}

.UiField__Label {
    display: block;
    width: 100%;
    margin-bottom: 8px;
    color: var(--ui-color-text);
    font-size: 13px;
    font-weight: 700;
    opacity: 1;
}

.UiField__Control {
    display: block;

    background: rgb(57, 61, 65);
    border: 1px solid rgb(74, 78, 82);
    border-radius: var(--ui-radius-small);

    width: 100%;
    min-height: 50px;
    padding: 13px 15px;

    color: rgb(245, 245, 245);
    font-size: 15px;
    line-height: 1.45;

    outline: none;
    transition: background var(--ui-transition-fast), border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

.UiField__Control:hover {
    background: rgb(61, 65, 69);
    border-color: rgb(91, 96, 101);
}

.UiField__Control:focus {
    background: rgb(57, 61, 65);
    border-color: var(--ui-color-brand);
    box-shadow: none;
}

.UiField__Control:disabled {
    background: rgb(50, 54, 58);
    color: var(--ui-color-muted);
    opacity: 0.55;
    cursor: not-allowed;
}

.UiField__Control::placeholder {
    color: rgb(158, 167, 176);
    opacity: 1;
}

textarea.UiField__Control {
    min-height: 116px;
    resize: vertical;
}

select.UiField__Control {
    appearance: none;
    background-image: linear-gradient(45deg, transparent 50%, rgb(158, 167, 176) 50%), linear-gradient(135deg, rgb(158, 167, 176) 50%, transparent 50%);
    background-position: calc(100% - 18px) 21px, calc(100% - 12px) 21px;
    background-repeat: no-repeat;
    background-size: 6px 6px, 6px 6px;
    padding-right: 38px;
    cursor: pointer;
}

/* Styling the shared custom select */
.UiSelect {
    position: relative;
    width: 100%;
}

.UiSelect__Native[hidden],
.UiSelect__Trigger[hidden],
.UiSelect__Menu[hidden] {
    display: none;
}

.UiSelect__Trigger {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 14px;

    background: rgb(57, 61, 65);
    border: 1px solid rgb(74, 78, 82);
    border-radius: var(--ui-radius-small);

    width: 100%;
    min-height: 50px;
    padding: 13px 15px;

    color: rgb(245, 245, 245);
    font-family: inherit;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.45;
    text-align: left;

    cursor: pointer;
    outline: none;
    transition: background var(--ui-transition-fast), border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

.UiSelect__Trigger:hover {
    background: rgb(61, 65, 69);
    border-color: rgb(91, 96, 101);
}

.UiSelect__Trigger:focus-visible,
.UiSelect.is-open .UiSelect__Trigger {
    background: rgb(57, 61, 65);
    border-color: var(--ui-color-brand);
    box-shadow: none;
}

.UiSelect__Trigger > span {
    min-width: 0;
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
}

.UiSelect__Trigger > i {
    color: rgb(158, 167, 176);
    font-size: 11px;
    transition: transform var(--ui-transition-fast);
}

.UiSelect.is-open .UiSelect__Trigger > i {
    transform: rotate(180deg);
}

.UiSelect__Menu {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 3px;

    background: rgb(48, 52, 56);
    border: 1px solid rgb(74, 78, 82);
    border-radius: var(--ui-radius-small);
    box-shadow: 0 16px 36px rgba(0, 0, 0, 0.3);

    position: absolute;
    z-index: 20;
    top: calc(100% + 6px);
    right: 0;
    left: 0;

    width: 100%;
    padding: 6px;
    overflow: hidden;
}

.UiSelect__Option {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;

    background: transparent;
    border: 0;
    border-radius: var(--ui-radius-small);

    width: 100%;
    min-height: 42px;
    padding: 10px 12px;

    color: rgb(227, 231, 235);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.4;
    text-align: left;

    cursor: pointer;
    outline: none;
    transition: background var(--ui-transition-fast), color var(--ui-transition-fast);
}

.UiSelect__Option:hover,
.UiSelect__Option:focus-visible {
    background: rgba(247, 198, 47, 0.18);
    color: rgb(255, 255, 255);
}

.UiSelect__Option[aria-selected="true"] {
    background: rgba(247, 198, 47, 0.16);
    color: var(--ui-color-brand);
    font-weight: 700;
}

.UiField__Hint,
.UiField__Error {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 6px;

    margin-top: 7px;
    color: var(--ui-color-muted);
    font-size: 11px;
    line-height: 1.45;
}

.UiField__Error {
    color: rgb(244, 158, 158);
}

.UiField--Error .UiField__Control {
    border-color: var(--ui-color-danger);
    box-shadow: none;
}

/* Styling the shared checkbox and radio */
.UiChoice,
.UiRadio,
.UiSwitch {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;

    width: auto;
    margin: 0;

    color: var(--ui-color-text);
    font-size: 13px;
    opacity: 1;
    cursor: pointer;
}

.UiChoice input,
.UiRadio input,
.UiSwitch input {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    clip: rect(0, 0, 0, 0);
    overflow: hidden;
}

.UiChoice > span,
.UiRadio > span {
    display: flex;
    align-items: center;
    justify-content: center;

    background: var(--ui-color-surface-strong);
    border: 1px solid var(--ui-color-border);

    position: relative;

    width: 22px;
    height: 22px;
    min-width: 22px;
    min-height: 22px;

    color: rgb(57, 61, 65);
    font-size: 11px;
    transition: background var(--ui-transition-fast), border-color var(--ui-transition-fast), box-shadow var(--ui-transition-fast);
}

.UiChoice > span {
    border-radius: var(--ui-radius-small);
}

.UiChoice > span::after {
    content: '';

    background: var(--ui-color-brand);
    border-radius: 7px;
    opacity: 0;
    transform: scale(0.6);

    width: 16px;
    height: 16px;
    transition: opacity var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.UiChoice input:checked + span {
    background: var(--ui-color-surface-strong);
    border-color: var(--ui-color-brand);
}

.UiChoice input:checked + span::after {
    opacity: 1;
    transform: scale(1);
}

.UiChoice > span > i {
    display: none;
}

.UiRadio > span {
    border-radius: 50%;
}

.UiRadio input:checked + span {
    background: radial-gradient(circle, var(--ui-color-brand) 0 4px, var(--ui-color-surface-strong) 5px);
    border-color: var(--ui-color-brand);
}

.UiChoice input:focus-visible + span,
.UiRadio input:focus-visible + span,
.UiSwitch input:focus-visible + span {
    box-shadow: var(--ui-shadow-focus);
}

.UiChoice strong,
.UiRadio strong,
.UiSwitch strong {
    font-size: 13px;
    font-weight: 500;
}

.UiSwitch > span {
    background: var(--ui-color-surface-strong);
    border: 1px solid var(--ui-color-border);
    border-radius: 100px;

    position: relative;

    width: 42px;
    height: 24px;
    min-width: 42px;
}

.UiSwitch > span::after {
    content: '';

    background: var(--ui-color-muted);
    border-radius: 50%;

    position: absolute;
    top: 4px;
    left: 4px;

    width: 14px;
    height: 14px;
    transition: background var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.UiSwitch input:checked + span {
    background: rgba(247, 198, 47, 0.14);
    border-color: var(--ui-color-brand);
}

.UiSwitch input:checked + span::after {
    background: var(--ui-color-brand);
    transform: translateX(18px);
}

/* Styling the shared tabs */
.UiTabs {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;

    width: 100%;
}

.UiTabs__List {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;

    border-bottom: 1px solid var(--ui-color-border);
    overflow-x: auto;
}

.UiTabs__Button {
    background: transparent;
    border: 0;
    border-bottom: 2px solid transparent;

    padding: 13px 15px;
    margin-bottom: -1px;

    color: var(--ui-color-muted);
    font-size: 13px;
    font-weight: 700;

    cursor: pointer;
}

.UiTabs__Button:hover,
.UiTabs__Button.is-active {
    color: var(--ui-color-brand);
}

.UiTabs__Button.is-active {
    border-bottom-color: var(--ui-color-brand);
}

.UiTabs__Button:focus-visible {
    box-shadow: inset var(--ui-shadow-focus);
}

.UiTabs__Panel {
    padding: 22px 2px 2px;
    color: var(--ui-color-muted);
    font-size: 14px;
    line-height: 1.7;
}

/* Styling the shared disclosure */
.UiDisclosure {
    border-bottom: 1px solid var(--ui-color-border);
}

.UiDisclosure summary {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    gap: 20px;

    padding: 18px 0;

    color: var(--ui-color-text);
    font-size: 14px;
    font-weight: 700;
    list-style: none;
    cursor: pointer;
}

.UiDisclosure summary::-webkit-details-marker {
    display: none;
}

.UiDisclosure summary > i {
    color: var(--ui-color-brand);
    transition: transform var(--ui-transition-fast);
}

.UiDisclosure[open] summary > i {
    transform: rotate(45deg);
}

.UiDisclosure p {
    max-width: 780px;
    margin: -3px 0 20px;
    color: var(--ui-color-muted);
    font-size: 13px;
    line-height: 1.7;
}

/* Styling the shared metric */
.UiMetric {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 5px 13px;

    background: var(--ui-color-surface);
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-medium);

    padding: 22px;
}

.UiMetric > i {
    grid-row: 1 / 4;

    display: flex;
    align-items: center;
    justify-content: center;

    background: rgba(247, 198, 47, 0.1);
    border-radius: 50%;

    width: 48px;
    height: 48px;

    color: var(--ui-color-brand);
    font-size: 19px;
}

.UiMetric > span,
.UiMetric > small {
    color: var(--ui-color-muted);
    font-size: 11px;
}

.UiMetric > strong {
    font-size: 22px;
}

/* Styling the shared table */
.UiTableWrap {
    border: 1px solid var(--ui-color-border);
    border-radius: var(--ui-radius-medium);

    width: 100%;
    overflow-x: auto;
}

.UiTable {
    border-collapse: collapse;
    width: 100%;
    min-width: 680px;
}

.UiTable th,
.UiTable td {
    border-bottom: 1px solid var(--ui-color-border);
    padding: 15px 18px;
    text-align: left;
}

.UiTable th {
    background: var(--ui-color-surface-strong);
    color: var(--ui-color-muted);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.UiTable td {
    color: var(--ui-color-text);
    font-size: 13px;
}

.UiTable tbody tr:last-child td {
    border-bottom: 0;
}

.UiTable tbody tr:hover {
    background: rgba(255, 255, 255, 0.02);
}

/* Styling the shared toast */
.UiToast {
    background: rgb(35, 38, 41);
    border: 1px solid rgba(247, 198, 47, 0.45);
    border-radius: var(--ui-radius-small);
    box-shadow: 0 16px 42px rgba(0, 0, 0, 0.34);

    position: fixed;
    z-index: 20;
    right: 22px;
    bottom: 22px;

    padding: 13px 17px;

    color: var(--ui-color-text);
    font-size: 13px;
    font-weight: 700;

    opacity: 0;
    pointer-events: none;
    transform: translateY(10px);
    transition: opacity var(--ui-transition-fast), transform var(--ui-transition-fast);
}

.UiToast.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media screen and (max-width: 520px){
    .UiButton {
        width: 100%;
        white-space: normal;
    }

    .UiToast {
        right: 17px;
        bottom: 17px;
        left: 17px;
        text-align: center;
    }
}

@media (prefers-reduced-motion: reduce){
    .UiButton,
    .UiIconButton,
    .UiDisclosure summary > i,
    .UiSwitch > span::after,
    .UiToast {
        transition: none;
    }
}
