/*
 * Settings → Accessibility Widget, in the look of Settings → AI Alt Generator (DockAccess AI Alt Generator):
 * #000bdf primary, #2b4df9 hover, #161952 body, #6b6d94 muted, #d7d7e3 lines, #f7f7fa surface, 8px radius,
 * Plus Jakarta Sans with a system fallback. Unlike there, buttons keep a visible focus ring.
 */

.afw {
    --afw-primary: #000bdf;
    --afw-primary-hover: #2b4df9;
    --afw-primary-tint: #f2f3ff;
    --afw-body: #161952;
    --afw-muted: #5c5e84;
    --afw-line: #d7d7e3;
    --afw-surface: #f7f7fa;
    --afw-green: #3bb96f;
    --afw-yellow: #eab400;
    --afw-red: #da4848;
    --afw-radius: 8px;
    --afw-radius-sm: 4px;
    --afw-radius-lg: 12px;
    --afw-font: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --afw-mono: "Roboto Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    color: var(--afw-body);
    font-family: var(--afw-font);
    letter-spacing: -.01em;
}

/* ------------------------------------------------------------------ brand bar */

.afw-brand {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    margin: 16px 0 20px;
    padding: 20px 24px;
    border-radius: var(--afw-radius-lg);
    background: linear-gradient(105deg, #000243 0%, #161952 55%, #000bdf 100%);
    color: #fff;
}

.afw-brand__mark {
    display: block;
    margin: 0;
    line-height: 0;
    color: #fff;
}

.afw-logo {
    display: block;
    width: 76px;
    height: 29px;
    color: inherit;
}

.afw-pill {
    padding: 5px 12px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 600;
}

.afw-pill.is-on {
    background: rgba(59, 185, 111, .22);
    box-shadow: inset 0 0 0 1px rgba(59, 185, 111, .5);
}

.afw-pill.is-off {
    background: rgba(255, 255, 255, .12);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .28);
}

/* ---------------------------------------------------------------------- cards */

.afw-card {
    margin: 20px 0;
    padding: 4px 24px 24px;
    border: 1px solid var(--afw-line);
    border-radius: var(--afw-radius-lg);
    background: #fff;
}

.afw .afw-card h2 {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin: 20px 0 4px;
    padding: 0;
    color: var(--afw-body);
    font-size: 16px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.afw-card p {
    font-size: 13px;
    line-height: 1.5;
}

.afw-lead {
    margin-top: 0;
    color: var(--afw-muted);
}

.afw .afw-card code {
    padding: 1px 6px;
    border-radius: var(--afw-radius-sm);
    background: #f1f1f6;
    color: var(--afw-body);
    font-family: var(--afw-mono);
    font-size: 12px;
}

/* Status: a coloured bar and dot; the words carry the meaning. */
.afw-status {
    border-left-width: 4px;
}

.afw-status h2::before {
    content: "";
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: currentColor;
}

.afw-status--ok {
    border-left-color: var(--afw-green);
    background: rgba(59, 185, 111, .07);
}

.afw-status--ok h2::before {
    color: var(--afw-green);
}

.afw-status--warning {
    border-left-color: var(--afw-yellow);
    background: rgba(234, 180, 0, .08);
}

.afw-status--warning h2::before {
    color: var(--afw-yellow);
}

.afw-status--error {
    border-left-color: var(--afw-red);
    background: rgba(218, 72, 72, .07);
}

.afw-status--error h2::before {
    color: var(--afw-red);
}

.afw-status--info {
    border-left-color: var(--afw-primary);
    background: var(--afw-surface);
}

.afw-status--info h2::before {
    color: var(--afw-primary);
}

.afw-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin: 14px 0 0;
}

.afw-notice .afw-actions {
    margin: 0 0 10px;
}

/* ---------------------------------------------------------------------- steps */

.afw-steps {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
    gap: 14px;
    margin: 16px 0 20px;
    padding: 0;
    list-style: none;
    counter-reset: afw-step;
}

.afw-steps li {
    position: relative;
    margin: 0;
    padding: 14px 16px 16px 46px;
    border: 1px solid var(--afw-line);
    border-radius: var(--afw-radius);
    background: var(--afw-surface);
    counter-increment: afw-step;
}

.afw-steps li::before {
    content: counter(afw-step);
    position: absolute;
    top: 14px;
    left: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: var(--afw-primary);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
}

.afw-steps strong {
    display: block;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.afw-steps span {
    display: block;
    margin: 2px 0 10px;
    color: var(--afw-muted);
    font-size: 13px;
    line-height: 1.5;
}

.afw-steps li:last-child span {
    margin-bottom: 0;
}

/* ---------------------------------------------------------------- connect form */

/* Token on its own row; login, password and the button side by side below it. */
.afw-connect__fields {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
    align-items: end;
    gap: 12px;
    max-width: 760px;
}

.afw-connect__field,
.afw-connect__submit {
    margin: 0;
}

.afw-connect__field--wide {
    grid-column: 1 / -1;
}

@media (max-width: 600px) {
    .afw-connect__fields {
        grid-template-columns: minmax(0, 1fr);
    }
}

.afw-connect label {
    display: block;
    margin-bottom: 6px;
    font-weight: 600;
}

.afw-connect input[type="text"],
.afw-connect input[type="password"] {
    width: 100%;
}

.afw-connect .description {
    max-width: 760px;
}

.afw .description {
    color: var(--afw-muted);
}

.afw input[type="text"],
.afw input[type="password"] {
    min-height: 34px;
    border: 1px solid var(--afw-line);
    border-radius: var(--afw-radius-sm);
    color: var(--afw-body);
    font-family: var(--afw-font);
    box-shadow: none;
}

.afw input.code {
    font-family: var(--afw-mono);
}

.afw input[type="text"]:focus,
.afw input[type="password"]:focus {
    border-color: var(--afw-primary);
    box-shadow: 0 0 0 2px rgba(0, 11, 223, .18);
    outline: none;
}

.afw input[aria-invalid="true"] {
    border-color: var(--afw-red);
    box-shadow: 0 0 0 1px var(--afw-red);
}

/* -------------------------------------------------------------------- buttons */

.afw .button-primary {
    min-height: 34px;
    border: 0;
    border-radius: var(--afw-radius-sm);
    background: var(--afw-primary);
    color: #fff;
    font-weight: 600;
    text-shadow: none;
    box-shadow: none;
}

.afw .button-primary:hover,
.afw .button-primary:focus {
    background: var(--afw-primary-hover);
    color: #fff;
}

.afw .button:not(.button-primary):not(.button-link) {
    min-height: 34px;
    border: 1px solid var(--afw-primary);
    border-radius: var(--afw-radius-sm);
    background: #fff;
    color: var(--afw-primary);
    font-weight: 600;
    box-shadow: none;
}

.afw .button:not(.button-primary):not(.button-link):hover,
.afw .button:not(.button-primary):not(.button-link):focus {
    background: var(--afw-primary-tint);
    border-color: var(--afw-primary-hover);
    color: var(--afw-primary);
}

.afw .button:focus-visible,
.afw .button-link:focus-visible {
    outline: 2px solid var(--afw-primary);
    outline-offset: 2px;
}

.afw .button-link.afw-danger {
    color: #b02a2a;
    font-weight: 600;
}

.afw .button-link.afw-danger:hover,
.afw .button-link.afw-danger:focus {
    color: #8a1f1f;
}

/* ---------------------------------------------------------------------- facts */

.afw-facts {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
    margin: 16px 0 4px;
}

.afw-facts > div {
    margin: 0;
    padding: 12px 14px;
    border: 1px solid var(--afw-line);
    border-radius: var(--afw-radius);
    background: #fff;
}

.afw-facts dt {
    color: var(--afw-muted);
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .06em;
}

.afw-facts dd {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
    margin: 3px 0 0;
    font-size: 14px;
    overflow-wrap: anywhere;
}

.afw-facts dd strong {
    font-size: 15px;
    font-weight: 700;
    letter-spacing: -.02em;
}

.afw-facts dd em {
    color: var(--afw-muted);
    font-size: 12px;
    font-style: normal;
}

.afw-meter {
    width: 100%;
    height: 8px;
    border: 0;
    border-radius: 999px;
    background: #e9e9ee;
    appearance: none;
}

.afw-meter::-webkit-progress-bar {
    border-radius: 999px;
    background: #e9e9ee;
}

.afw-meter::-webkit-progress-value {
    border-radius: 999px;
    background: var(--afw-primary);
}

.afw-meter::-moz-progress-bar {
    border-radius: 999px;
    background: var(--afw-primary);
}

.afw-meter.is-full::-webkit-progress-value {
    background: var(--afw-red);
}

.afw-meter.is-full::-moz-progress-bar {
    background: var(--afw-red);
}

/* --------------------------------------------------------- hint and toolbar */

.afw-hint {
    margin: 0 0 12px;
    padding: 10px 14px;
    border: 1px solid rgba(234, 180, 0, .45);
    border-radius: var(--afw-radius);
    background: rgba(234, 180, 0, .1);
    color: #6b5200;
}

.afw-hint p {
    margin: 0;
}

.afw-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.afw-toolbar form {
    margin: 0;
}
