/* ==========================================================================
   Account
   The Account page (account/account.html) and setting up two-factor sign-in
   (account/two_factor_app.html, two_factor_email.html). See
   installer/accounts.py. The pages are built on components.css's panels and
   the record sheet; the sign-in code step and the emailed links' pages are
   in sign-in.css.
   ========================================================================== */

/* ----- The Account page: two columns on wide screens ----- */
.account-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 20px;
    align-items: start;
}

@media (min-width: 1100px) {
    .account-grid {
        grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
        gap: 22px;
    }
}

.account-grid__column {
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-width: 0;
}

/* Profile: the record's labelled fields, in a panel */
.account-fields {
    padding: 12px 16px 14px;
}

.account-fields .record-fields__row {
    align-items: center;
}

/* Phones: each label above its value, so an email has the width */
@media (max-width: 480px) {
    .account-fields .record-fields__row {
        grid-template-columns: minmax(0, 1fr);
        gap: 0;
        padding: 5px 0;
    }
}

.account-code {
    padding: 1px 6px;
    border-radius: 4px;
    background-color: var(--in-wash);
    color: var(--in-text);
    font-size: 0.8rem;
}

/* On, Off, Verified, Not verified */
.account-status {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    margin-left: 6px;
    padding: 1px 8px;
    border-radius: 999px;
    background-color: var(--in-idle-wash);
    color: var(--in-idle-text);
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1.6;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: 1px;
}

.panel__head .account-status {
    margin-left: 0;
}

.account-status--on {
    background-color: var(--in-complete-wash);
    color: var(--in-complete-text);
}

.account-status--warn {
    background-color: var(--in-amber-wash);
    color: var(--in-amber-text);
}

/* Verify your email address, above the profile's fields */
.account-notice {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px 12px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--in-border-soft);
    background-color: var(--in-amber-wash);
}

.account-notice__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--in-surface);
    color: var(--in-amber-text);
}

.account-notice__text {
    display: flex;
    flex: 1 1 180px;
    flex-direction: column;
    min-width: 0;
    color: var(--in-text);
    font-size: 0.86rem;
    line-height: 1.4;
}

.account-notice__text span {
    color: var(--in-text-muted);
    font-size: 0.78rem;
}

.account-notice form {
    margin: 0;
}

/* ----- Forms: the password change, and the modals' password ----- */
.account-form {
    padding: 14px 16px 16px;
}

.account-field + .account-field {
    margin-top: 12px;
}

.account-field__label {
    display: block;
    margin-bottom: 4px;
    color: var(--in-text-muted);
    font-size: 0.78rem;
    font-weight: 600;
}

.account-form .form-control {
    max-width: 420px;
}

.account-field .form-control {
    font-size: 0.9rem;
}

.account-field--error .form-control {
    border-color: var(--in-danger-border);
}

.account-field__error {
    margin: 5px 0 0;
    color: var(--in-danger);
    font-size: 0.8rem;
}

.account-form__actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 16px;
}

.account-modal__text {
    margin-bottom: 14px;
    color: var(--in-text-2);
    font-size: 0.9rem;
}

/* ----- Two-factor: a row per way, the one in use marked ----- */
.account-option {
    display: flex;
    align-items: center;
    gap: 12px 14px;
    padding: 14px 16px;
    border-top: 1px solid var(--in-border-soft);
}

.panel__head + .account-option {
    border-top: 0;
}

.account-option__icon {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 10px;
    background-color: var(--in-accent-wash);
    color: var(--in-accent);
    font-size: 1.15rem;
}

/* The phone glyph is narrow */
.account-option__icon .fa-mobile {
    font-size: 1.55rem;
}

.account-option--on .account-option__icon {
    background-color: var(--in-accent);
    color: var(--in-surface);
}

.account-option__body {
    flex: 1 1 auto;
    min-width: 0;
}

/* !important: styles.css sets every h3's size, !important, on phones */
.account-option__title {
    margin: 0;
    color: var(--in-text);
    font-family: inherit;
    font-size: 0.92rem !important;
    font-weight: 600;
    line-height: 1.35;
}

.account-option__text {
    margin: 2px 0 0;
    color: var(--in-text-muted);
    font-size: 0.8rem;
    line-height: 1.45;
    overflow-wrap: anywhere;
}

.account-option > form {
    flex: none;
    margin: 0;
}

/* Phones: the button under the text */
@media (max-width: 480px) {
    .account-option {
        flex-wrap: wrap;
    }

    .account-option__body {
        flex-basis: calc(100% - 52px);
    }

    .account-option > .portal-btn,
    .account-option > form {
        margin-left: 52px;
    }
}

/* ----- Preferences: a settings list. Groups under a heading, a row each,
   its label at the start and its control (a segmented toggle, a switch or
   a select) at the end ----- */
.account-settings__group {
    display: block;
    margin: 0;
    padding: 14px 16px 6px;
}

.account-settings__group + .account-settings__group {
    border-top: 1px solid var(--in-border-soft);
}

/* !important: styles.css sets every h3's size, !important, on phones */
.account-settings__heading {
    margin: 0 0 2px;
    color: var(--in-text);
    font-family: inherit;
    font-size: 0.82rem !important;
    font-weight: 700;
    line-height: 1.4;
}

.account-settings__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 6px 16px;
    min-height: 46px;
    padding: 6px 0;
}

.account-settings__row + .account-settings__row {
    border-top: 1px dashed var(--in-border-soft);
}

.account-settings__label {
    flex: 1 1 160px;
    min-width: 0;
    margin: 0;
    color: var(--in-text-2);
    font-size: 0.86rem;
    font-weight: 400;
    line-height: 1.4;
}

.account-settings__control {
    flex: none;
    margin: 0;
}

/* Beats forms.css's width: 100% */
select.account-settings__control {
    width: 230px;
    max-width: 100%;
    height: 34px !important;
    font-size: 0.85rem;
}

.account-settings__actions {
    display: flex;
    justify-content: flex-end;
    padding: 4px 0 10px;
}

/* Phones: a select under its label, the width of the row */
@media (max-width: 480px) {
    select.account-settings__control {
        flex: 1 1 100%;
        width: 100%;
    }
}

/* ----- Setting up two-factor ----- */
.account-setup {
    max-width: 760px;
}

.account-step {
    display: flex;
    gap: 14px;
    padding: 20px 18px;
    border-top: 1px solid var(--in-border-soft);
}

.account-step:first-child,
.panel__head + .account-step {
    border-top: 0;
}

.account-step__number {
    display: inline-flex;
    flex: none;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: var(--in-button);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
}

.account-step__body {
    flex: 1 1 auto;
    min-width: 0;
}

/* !important: styles.css sets every h2's size, !important, on phones */
.account-step__title {
    margin: 3px 0 6px;
    color: var(--in-text);
    font-family: inherit;
    font-size: 1rem !important;
    font-weight: 600;
    line-height: 1.35;
}

.account-step__text {
    margin: 0 0 14px;
    color: var(--in-text-muted);
    font-size: 0.86rem;
    line-height: 1.5;
}

/* The QR code beside the key to type in */
.totp-pair {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 16px 24px;
}

/* White in both themes: scanners want dark on light. The code has its own
   margin. */
.totp-qr-frame {
    flex: none;
    width: 184px;
    overflow: hidden;
    border: 1px solid var(--in-border);
    border-radius: 10px;
    background-color: #fff;
}

.totp-qr {
    display: block;
    width: 100%;
    height: auto;
}

.totp-key {
    flex: 1 1 240px;
    min-width: 0;
}

.totp-key__label {
    display: block;
    margin-bottom: 6px;
    color: var(--in-text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.totp-key__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
}

.totp-key__value {
    padding: 7px 10px;
    border: 1px solid var(--in-border-input);
    border-radius: 6px;
    background-color: var(--in-sheet);
    color: var(--in-text);
    font-size: 0.9rem;
    letter-spacing: 0.08em;
    overflow-wrap: anywhere;
}

/* A 6-digit code and its button */
.account-code-form {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 0;
}

.account-code-input.form-control {
    width: 150px;
    height: 38px;
    font-family: SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 1.1rem;
    letter-spacing: 0.2em;
    text-align: center;
}

.account-code-input--error.form-control {
    border-color: var(--in-danger-border);
}

.account-code-form .portal-btn {
    min-height: 38px;
}

.account-resend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px;
    margin: 14px 0 0;
    color: var(--in-text-muted);
    font-size: 0.82rem;
}

/* A form's button that reads as a link: Send a new code */
.account-link-button {
    padding: 0;
    border: 0;
    background: none;
    color: var(--in-accent);
    font: inherit;
    font-weight: 600;
    cursor: pointer;
}

.account-link-button:hover,
.account-link-button:focus {
    text-decoration: underline;
}
