/* /start and the Min bruker dialog. */

/* /start: the two steps, the shortcut back, and the lists. */

/* The second step fills the window; its parts keep the same spacing as the first step's stack. */
.ms-fill-page.start {
    gap: 14px;
}

/* On a phone the list would be squeezed under the rest, so the page scrolls as a whole instead. */
@media (max-width: 700px) {
    .ms-fill-page.start {
        height: auto;
    }

    .ms-fill-page.start .ms-fill,
    .ms-fill-page.start .ms-fill-grid,
    .ms-fill-page.start .ms-tab-fill,
    .ms-fill-page.start .mud-tabs-panels,
    .ms-fill-page.start .ms-fill-grid > .mud-table-container {
        flex: none !important;
        overflow: visible !important;
    }
}

.start-steps {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
    font-size: .875rem;
}

.start-steps__current {
    color: var(--mud-palette-text-primary);
    font-weight: 600;
}

.start-steps__done {
    padding: 0;
    border: 0;
    background: none;
    color: var(--mud-palette-primary);
    font: inherit;
    cursor: pointer;
}

.start-steps__done:hover {
    text-decoration: underline;
    text-underline-offset: 3px;
}

/* The step not reached yet is shown, not hidden: it says a second choice is coming. */
.start-steps__todo,
.start-steps__sep {
    color: var(--ms-ink-3);
}

.start-steps__sep {
    display: inline-flex;
}

.start-steps__sep .material-symbols-outlined {
    font-size: 18px;
}

/* The shortcut back to what was last used: the whole bar is the button. */
.start-resume {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 12px 16px;
    border: 1px solid var(--mud-palette-primary);
    border-radius: var(--ms-radius);
    background-color: color-mix(in srgb, var(--mud-palette-primary) 7%, var(--mud-palette-surface));
    color: var(--mud-palette-text-primary);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color 120ms ease;
}

.start-resume:hover {
    background-color: color-mix(in srgb, var(--mud-palette-primary) 13%, var(--mud-palette-surface));
}

.start-resume:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: 2px;
}

.start-resume__icon {
    color: var(--mud-palette-primary);
    font-size: 26px;
}

.start-resume__text {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
}

.start-resume__label {
    color: var(--mud-palette-primary);
    font-size: .75rem;
    font-weight: 600;
}

.start-resume__name {
    overflow: hidden;
    font-size: 1rem;
    font-weight: 600;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.start-resume__kind {
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

.start-resume__go {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: var(--mud-default-borderradius);
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: .875rem;
    font-weight: 600;
}

.start-resume__go .material-symbols-outlined {
    font-size: 18px;
}

/* The lists: every row picks, so the whole row is the target. */
.start-table .mud-table-body .mud-table-row,
.start-grid .mud-table-body .mud-table-row {
    cursor: pointer;
}

.start-table .start-name {
    font-weight: 500;
}

.start-content {
    display: block;
    font-weight: 500;
}

.start-muted {
    display: block;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

td.start-muted {
    display: table-cell;
}

.start-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 6px;
}

.start-tag {
    padding: 1px 8px;
    border-radius: 999px;
    background-color: color-mix(in srgb, var(--mud-palette-info) 12%, transparent);
    color: var(--mud-palette-text-primary);
    font-family: var(--ms-font-ui);
    font-size: .75rem;
}

.start-tag--owner {
    background-color: color-mix(in srgb, var(--mud-palette-success) 14%, transparent);
}

/* Selskaper i konsernet: the search and the filter over the list. */
.start-membership {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.start-membership__tools {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
}

.start-membership__tools > .mud-input-control {
    flex: 1 1 260px;
    margin: 0;
}

/* A row marked to be removed once the dialog is saved. Still readable, and still able to be taken back. */
.ms-row-removed td {
    text-decoration: line-through;
    color: var(--mud-palette-text-disabled);
}

/* The status chip brings its own height, which would otherwise decide the row's. Two classes deep so it
   outranks MudBlazor's own dense padding. */
.ms-membership__grid td.mud-table-cell {
    padding-top: 0;
    padding-bottom: 0;
}

.ms-membership__grid td.mud-table-cell .mud-chip {
    margin: 0;
}

/* Virtualized, which assumes one row height: every row stays on one line and a long name ends in an ellipsis. */
.ms-membership__grid table {
    table-layout: fixed;
}

.ms-membership__grid td {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* Min bruker: categories on the left, one pane on the right. The panes are also shown on their own routes
   (/profile/password, /profile/two-factor), so they carry their own heading. */

.ms-myuser__who {
    display: flex;
    align-items: center;
    gap: 14px;
}

.ms-myuser__avatar {
    display: grid;
    place-items: center;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--mud-palette-primary);
    color: var(--mud-palette-primary-text);
    font-size: 1rem;
    font-weight: 600;
}

.ms-myuser__body {
    display: flex;
    /* One height for every category: the panes differ a lot in content, and a dialog that resizes under
       the pointer is hard to use. */
    height: clamp(24rem, 62vh, 34rem);
    /* Edge to edge in the dialog, down to the action bar: the content's own side and bottom padding is
       given back, so the menu's fill meets the bar with no strip of dialog between. */
    margin: 0 -24px -20px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.ms-myuser__nav {
    display: flex;
    flex: 0 0 auto;
    flex-direction: column;
    width: 14rem;
    overflow-y: auto;
    padding: 8px 0;
    border-right: 1px solid var(--mud-palette-lines-default);
    background-color: var(--ms-surface-2);
}

.ms-myuser__item {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 10px;
    width: 100%;
    padding: 9px 18px;
    border: 0;
    background: none;
    color: var(--mud-palette-text-primary);
    font: inherit;
    font-size: .875rem;
    text-align: left;
    cursor: pointer;
}

.ms-myuser__item .material-symbols-outlined {
    color: var(--mud-palette-text-secondary);
    font-size: 20px;
}

.ms-myuser__item:hover:not(:disabled) {
    background-color: var(--mud-palette-action-default-hover);
}

.ms-myuser__item:focus-visible {
    outline: 2px solid var(--mud-palette-primary);
    outline-offset: -2px;
}

.ms-myuser__item:disabled {
    color: var(--mud-palette-text-disabled);
    cursor: default;
}

.ms-myuser__item--on {
    font-weight: 600;
    color: var(--mud-palette-primary);
    background-color: var(--mud-palette-primary-lighten);
    box-shadow: inset 3px 0 0 var(--mud-palette-primary);
}

.ms-myuser__item--on .material-symbols-outlined {
    color: var(--mud-palette-primary);
}

.ms-myuser__item--danger,
.ms-myuser__item--danger .material-symbols-outlined {
    color: var(--mud-palette-error);
}

.ms-myuser__sep {
    margin: 8px 0;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.ms-myuser__pane {
    flex: 1 1 auto;
    padding: 22px 28px;
    min-width: 0;
    overflow-y: auto;
}

.ms-myuser__locked {
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

@media (max-width: 700px) {
    .ms-myuser__body {
        flex-direction: column;
        height: auto;
        max-height: 70vh;
        overflow-y: auto;
    }

    .ms-myuser__nav {
        width: auto;
        border-right: 0;
        border-bottom: 1px solid var(--mud-palette-lines-default);
    }
}

/* A pane: its heading, then its parts at one spacing. */
.myuser-pane {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
    max-width: 560px;
}

.myuser-pane > * {
    max-width: 100%;
}

.myuser-pane__head h2 {
    margin: 0;
    color: var(--mud-palette-text-primary);
    font-family: var(--ms-font-ui);
    font-size: 1.0625rem;
    font-weight: 600;
}

.myuser-pane__head p {
    margin: 4px 0 0;
    color: var(--mud-palette-text-secondary);
    font-size: .875rem;
}

.myuser-pane__text {
    margin: 0;
    color: var(--mud-palette-text-secondary);
    font-size: .875rem;
}

/* A side remark under the fields: what the pane cannot do yet, or why. */
.myuser-pane__note {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    margin: 0;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

.myuser-pane__note .material-symbols-outlined {
    color: var(--mud-palette-info);
    font-size: 18px;
}

.myuser-pane__part {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    width: 100%;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-lines-default);
}

.myuser-pane__part h3 {
    margin: 0;
    font-size: .9375rem;
    font-weight: 600;
}

.myuser-fields {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 16px;
    width: 100%;
}

.myuser-fields--single {
    grid-template-columns: minmax(0, 1fr);
    max-width: 22rem;
}

.myuser-fields--narrow {
    grid-template-columns: minmax(0, 1fr);
    max-width: 14rem;
}

.myuser-fields > .mud-input-control {
    margin: 0;
}

@media (max-width: 700px) {
    .myuser-fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.myuser-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* The ways in, one row each, with whether it is on. */
.myuser-list {
    width: 100%;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
}

.myuser-list__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 16px;
}

.myuser-list__row + .myuser-list__row {
    border-top: 1px solid var(--mud-palette-lines-default);
}

.myuser-list__name {
    font-weight: 500;
}

.myuser-list__detail {
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

/* Recovery codes: in two columns, in a face where 0 and O, 1 and l cannot be mistaken. */
.myuser-codes {
    display: grid;
    grid-template-columns: repeat(2, max-content);
    gap: 6px 32px;
    padding: 14px 18px;
    border-radius: var(--mud-default-borderradius);
    background-color: var(--ms-surface-2);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: .9375rem;
}

.myuser-qr {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 20px;
}

.myuser-qr img {
    padding: 8px;
    border-radius: var(--mud-default-borderradius);
    background-color: var(--ms-qr-ground);
}

.myuser-qr__manual {
    display: flex;
    flex-direction: column;
    gap: 4px;
    color: var(--mud-palette-text-secondary);
    font-size: .8125rem;
}

.myuser-qr__manual code {
    color: var(--mud-palette-text-primary);
    font-family: ui-monospace, "Cascadia Mono", Consolas, monospace;
    font-size: .875rem;
    letter-spacing: .04em;
}

/* What closing the user does, one line each. */
.myuser-facts {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin: 0;
    padding: 14px 16px;
    list-style: none;
    border: 1px solid var(--mud-palette-lines-default);
    border-radius: var(--mud-default-borderradius);
    font-size: .875rem;
}

.myuser-facts li {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.myuser-facts .material-symbols-outlined {
    color: var(--mud-palette-text-secondary);
    font-size: 20px;
}

.myuser-facts--danger .material-symbols-outlined {
    color: var(--mud-palette-error);
}

/* /profile/password and /profile/two-factor: the pane in a card of a readable width. */
.myuser-route {
    max-width: 640px;
}
