/* Account (Identity) pages.
 *
 * These pages render under static SSR -- App.razor gives every /Account path a
 * null render mode so Identity can set cookies -- so MudBlazor components are
 * not an option here: MudTextField and friends need a circuit to bind, and a
 * MudButton's OnClick would never fire. The pages therefore stay on Blazor's
 * SSR form primitives (EditForm/InputText, which post like plain HTML) and get
 * their looks from this file instead.
 *
 * The class vocabulary is the one the .NET Identity template already ships --
 * .form-floating, .btn, .alert, .row/.col-md-* and so on. Those are Bootstrap
 * names, but Bootstrap was never referenced by this app, so until now every one
 * of them was inert and the pages rendered as raw unstyled HTML. Implementing
 * the vocabulary here styles all ~30 Identity pages, including the ones no
 * feature currently links to, without touching a single form binding.
 *
 * Colours come from the MudBlazor palette (MudThemeProvider emits the custom
 * properties as markup, so they are present under SSR) and the accent is the
 * same gradient Home.razor uses for its hero, so these pages read as part of
 * the app rather than as the template they came from.
 *
 * Everything is scoped under .acct-page -- applied by AccountLayout -- so these
 * generic names cannot leak into the MudBlazor pages.
 */

.acct-page {
    --acct-accent-from: #667eea;
    --acct-accent-to: #764ba2;
    --acct-gap: 20px;

    display: flex;
    justify-content: center;
    padding: 32px 16px 64px;
}

/* ---- the card ----------------------------------------------------------- */

.acct-card {
    position: relative;
    width: 100%;
    max-width: 460px;
    padding: 34px 32px 30px;
    background: var(--mud-palette-surface, #fff);
    color: var(--mud-palette-text-primary, #424242);
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2),
                0 2px 2px 0 rgba(0, 0, 0, .14),
                0 1px 5px 0 rgba(0, 0, 0, .12);
}

/* The Manage section is a two-column layout and needs the room. */
.acct-page-wide .acct-card {
    max-width: 940px;
}

/* Ties the card to the Home hero without repeating the whole gradient panel. */
.acct-card::before {
    content: "";
    position: absolute;
    inset: 0 0 auto 0;
    height: 4px;
    background: linear-gradient(90deg, var(--acct-accent-from), var(--acct-accent-to));
}

/* ---- headings ----------------------------------------------------------- */

.acct-card h1 {
    margin: 0 0 4px;
    font-size: 26px;
    font-weight: 500;
    line-height: 1.25;
    letter-spacing: -.2px;
}

/* The template pairs an h1 with a restating h2 ("Log in" / "Use a local account
   to log in."). Demoted to a subtitle rather than deleted from 30 files. */
.acct-card h2 {
    margin: 0 0 var(--acct-gap);
    font-size: 14px;
    font-weight: 400;
    line-height: 1.45;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, .54));
}

.acct-card h3 {
    margin: 26px 0 10px;
    font-size: 15px;
    font-weight: 500;
}

/* The template's rules only ever sat under a heading that now carries its own
   spacing, so they are noise. */
.acct-card hr {
    display: none;
}

.acct-card p {
    margin: 0 0 12px;
    font-size: 14px;
    line-height: 1.55;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, .54));
}

.acct-card a {
    color: var(--mud-palette-primary, #1976d2);
    text-decoration: none;
}

.acct-card a:hover {
    text-decoration: underline;
}

/* ---- grid --------------------------------------------------------------- */

/* The template's .row/.col-md-* are load-bearing for nothing but grouping here:
   the card is already one narrow column, so they collapse to blocks. The Manage
   split is the one real two-column case and is handled below. */
.acct-page .row {
    display: block;
}

.acct-page [class*="col-md-"] {
    width: 100%;
}

/* ---- fields ------------------------------------------------------------- */

.acct-page .form-floating {
    position: relative;
}

.acct-page .mb-3 {
    margin-bottom: 18px;
}

.acct-page .form-control {
    display: block;
    width: 100%;
    height: 56px;
    padding: 22px 13px 7px;
    font-family: inherit;
    font-size: 16px;
    line-height: 1.2;
    color: var(--mud-palette-text-primary, #424242);
    background: var(--mud-palette-surface, #fff);
    border: 1px solid var(--mud-palette-lines-inputs, #bdbdbd);
    border-radius: var(--mud-default-borderradius, 4px);
    transition: border-color .15s ease, box-shadow .15s ease;
    appearance: none;
}

.acct-page .form-control:hover:not(:disabled) {
    border-color: var(--mud-palette-text-primary, #424242);
}

.acct-page .form-control:focus {
    outline: none;
    border-color: var(--mud-palette-primary, #1976d2);
    box-shadow: inset 0 0 0 1px var(--mud-palette-primary, #1976d2);
}

/* A pinned invite address is posted but not editable; say so visually. */
.acct-page .form-control[readonly] {
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .03));
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, .54));
    cursor: not-allowed;
}

/* The label is the placeholder, so the real one must not double it up. */
.acct-page .form-control::placeholder {
    color: transparent;
}

.acct-page .form-floating > label {
    position: absolute;
    top: 0;
    left: 0;
    padding: 17px 14px;
    font-size: 16px;
    line-height: 1.2;
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, .54));
    pointer-events: none;
    transform-origin: 0 0;
    transition: transform .15s ease, color .15s ease;
}

/* Floats on focus, and stays floated once there is a value. An input with no
   placeholder attribute never matches :placeholder-shown, so its label simply
   starts floated -- which is the right resting state for it. */
.acct-page .form-floating > .form-control:focus ~ label,
.acct-page .form-floating > .form-control:not(:placeholder-shown) ~ label {
    transform: scale(.75) translateY(-11px);
}

.acct-page .form-floating > .form-control:focus ~ label {
    color: var(--mud-palette-primary, #1976d2);
}

/* ---- checkbox ----------------------------------------------------------- */

.acct-page .checkbox {
    margin-bottom: 18px;
}

.acct-page .checkbox label,
.acct-page label.form-label:has(input[type="checkbox"]) {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    font-size: 14px;
    color: var(--mud-palette-text-primary, #424242);
    cursor: pointer;
}

.acct-page input[type="checkbox"] {
    width: 18px;
    height: 18px;
    margin: 0;
    accent-color: var(--mud-palette-primary, #1976d2);
    cursor: pointer;
}

/* ---- buttons ------------------------------------------------------------ */

.acct-page .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 40px;
    padding: 8px 20px;
    border: none;
    border-radius: var(--mud-default-borderradius, 4px);
    font-family: inherit;
    font-size: 14px;
    font-weight: 500;
    line-height: 1.75;
    letter-spacing: .0892857143em;
    text-transform: uppercase;
    text-decoration: none;
    cursor: pointer;
    transition: background-color .2s ease, box-shadow .2s ease;
}

.acct-page .btn-lg {
    min-height: 46px;
    font-size: 15px;
}

.acct-page .w-100 {
    width: 100%;
}

.acct-page .btn-primary {
    color: var(--mud-palette-primary-text, #fff);
    background: var(--mud-palette-primary, #1976d2);
    box-shadow: 0 3px 1px -2px rgba(0, 0, 0, .2),
                0 2px 2px 0 rgba(0, 0, 0, .14),
                0 1px 5px 0 rgba(0, 0, 0, .12);
}

.acct-page .btn-primary:hover {
    background: var(--mud-palette-primary-darken, #1565c0);
}

.acct-page .btn-danger {
    color: var(--mud-palette-error-text, #fff);
    background: var(--mud-palette-error, #f44336);
}

.acct-page .btn-danger:hover {
    background: var(--mud-palette-error-darken, #d32f2f);
}

.acct-page .btn-link {
    color: var(--mud-palette-primary, #1976d2);
    background: none;
    box-shadow: none;
    padding-left: 0;
    padding-right: 0;
    text-transform: none;
    letter-spacing: normal;
}

.acct-page .btn:focus-visible {
    outline: 2px solid var(--mud-palette-primary, #1976d2);
    outline-offset: 2px;
}

/* ---- alerts and validation ---------------------------------------------- */

.acct-page .alert {
    margin: 0 0 var(--acct-gap);
    padding: 11px 14px;
    border-radius: var(--mud-default-borderradius, 4px);
    font-size: 14px;
    line-height: 1.45;
    border: 1px solid transparent;
}

.acct-page .alert p {
    margin: 0 0 6px;
    color: inherit;
}

.acct-page .alert p:last-child {
    margin-bottom: 0;
}

.acct-page .alert-danger {
    color: var(--mud-palette-error, #f44336);
    background: rgba(244, 67, 54, .1);
    border-color: rgba(244, 67, 54, .3);
}

.acct-page .alert-success {
    color: var(--mud-palette-success, #4caf50);
    background: rgba(76, 175, 80, .1);
    border-color: rgba(76, 175, 80, .3);
}

.acct-page .alert-info {
    color: var(--mud-palette-info, #2196f3);
    background: rgba(33, 150, 243, .1);
    border-color: rgba(33, 150, 243, .3);
}

.acct-page .alert-warning {
    color: var(--mud-palette-warning-darken, #b26a00);
    background: rgba(255, 152, 0, .12);
    border-color: rgba(255, 152, 0, .35);
}

.acct-page .text-danger {
    color: var(--mud-palette-error, #f44336);
    font-size: 13px;
}

.acct-page .text-info {
    color: var(--mud-palette-info, #2196f3);
}

.acct-page .text-success {
    color: var(--mud-palette-success, #4caf50);
}

/* ValidationSummary renders a <ul>; the per-field messages already say it. */
.acct-page .validation-errors {
    margin: 0 0 var(--acct-gap);
    padding-left: 18px;
    font-size: 13px;
    color: var(--mud-palette-error, #f44336);
}

.acct-page .validation-message {
    display: block;
    margin-top: 5px;
    font-size: 12.5px;
    color: var(--mud-palette-error, #f44336);
}

/* ---- footer links under a form ------------------------------------------ */

.acct-links {
    margin-top: 22px;
    padding-top: 16px;
    border-top: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, .12));
    display: flex;
    flex-direction: column;
    gap: 9px;
    font-size: 14px;
}

.acct-links p {
    margin: 0;
}

/* ---- Manage section ----------------------------------------------------- */

.acct-manage {
    display: grid;
    grid-template-columns: 210px minmax(0, 1fr);
    gap: 28px;
    align-items: start;
}

@media (max-width: 720px) {
    .acct-manage {
        grid-template-columns: 1fr;
        gap: 18px;
    }
}

.acct-page .nav-pills {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.acct-page .nav-link {
    display: block;
    padding: 9px 14px;
    border-radius: var(--mud-default-borderradius, 4px);
    font-size: 14px;
    color: var(--mud-palette-text-primary, #424242);
    text-decoration: none;
    transition: background-color .15s ease;
}

.acct-page .nav-link:hover {
    background: var(--mud-palette-action-default-hover, rgba(0, 0, 0, .04));
    text-decoration: none;
}

.acct-page .nav-link.active {
    color: var(--mud-palette-primary, #1976d2);
    background: var(--mud-palette-primary-hover, rgba(25, 118, 210, .07));
    font-weight: 500;
}

/* ---- misc template bits ------------------------------------------------- */

.acct-page .recovery-code {
    display: inline-block;
    margin: 3px 0;
    padding: 5px 10px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 14px;
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .04));
    border-radius: var(--mud-default-borderradius, 4px);
}

.acct-page .table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

.acct-page .table th,
.acct-page .table td {
    padding: 9px 10px;
    text-align: left;
    border-bottom: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, .12));
}

.acct-page .font-weight-bold {
    font-weight: 600;
}

/* Bootstrap's icon font is not loaded either; the alert colour carries the
   warning on its own. */
.acct-page .glyphicon {
    display: none;
}

/* Manage/Email pairs a disabled field with a "confirmed" tick. Laid out as a
   row so the tick sits beside the field rather than on top of the label. */
.acct-page .input-group {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.acct-page .input-group > .form-control {
    flex: 1 1 auto;
}

.acct-page .input-group-append {
    display: flex;
    align-items: center;
}

.acct-page .input-group-text {
    display: inline-flex;
    align-items: center;
    padding: 0 12px;
    height: 56px;
    font-size: 18px;
    border: 1px solid var(--mud-palette-lines-default, rgba(0, 0, 0, .12));
    border-radius: var(--mud-default-borderradius, 4px);
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .03));
}

.acct-page .form-control:disabled {
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .03));
    color: var(--mud-palette-text-secondary, rgba(0, 0, 0, .54));
}

/* EnableAuthenticator's numbered setup steps. */
.acct-page ol.list {
    margin: 0 0 var(--acct-gap);
    padding-left: 20px;
    font-size: 14px;
}

.acct-page ol.list > li {
    margin-bottom: 14px;
}

.acct-page kbd {
    display: inline-block;
    padding: 3px 7px;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 13px;
    background: var(--mud-palette-background-gray, rgba(0, 0, 0, .06));
    border-radius: 3px;
}

/* ---- phone -------------------------------------------------------------- */

@media (max-width: 599px) {
    .acct-page {
        padding: 16px 10px 48px;
    }

    .acct-card {
        padding: 26px 20px 24px;
        border-radius: 8px;
    }

    .acct-card h1 {
        font-size: 22px;
    }
}
