/* Design tokens from Figma: DESIGN (Password Manager) */
:root {
    --labels-primary: #101828;
    --labels-secondary: #6d7788;
    --labels-tertiary: #98a2b3;
    --background-base: #ffffff;
    --background-secondary: #f6f6f6;
    --background-tertiary: #ebebeb;
    --buttons-primary: #1f69ff;
    --gray-50: #f9fafb;
    --gray-300: #d0d5dd;
    --gray-800: #1d2939;
    --gray-900: #181d27;
    --error-700: #d71236;
    --success-600: #039855;
    --success-25: #f6fef9;
    --separator-opaque: #eeefef;
    --border: #e5e5e5;
    --nav-background: #13161a;
    --gap-4: 16px;
    --radius-card: 4px;
    --radius-control: 5px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    padding: 0;
}

body {
    background: var(--background-base);
    color: var(--labels-primary);
    font-family: Inter, "Segoe UI", "Helvetica Neue", Arial, sans-serif;
    font-size: 12px;
    line-height: 18px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* Navigation Header */
.nav-header {
    background: var(--nav-background);
    height: 48px;
    display: flex;
    align-items: center;
    padding: 0 16px;
    flex: none;
    overflow: hidden;
}

.nav-header .brand-group {
    display: flex;
    align-items: center;
    gap: 20px;
}

.nav-header .brand-logo {
    display: block;
    width: 108px;
    height: 25px;
}

/* Page shell */
.page-body {
    flex: 1 0 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 40px 0;
    width: 100%;
}

.page-panel {
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: flex-start;
    width: 486px;
}

.page-header-lockup {
    display: flex;
    flex-direction: column;
    gap: 8px;
    width: 100%;
}

.page-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    line-height: normal;
    color: var(--labels-primary);
}

/* Card */
.card {
    display: flex;
    flex-direction: column;
    gap: var(--gap-4);
    align-items: center;
    justify-content: center;
    width: 100%;
    background: var(--background-base);
    border-radius: var(--radius-card);
    box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    padding-top: 16px;
}

.card--padded {
    padding-bottom: 16px;
}

.card__body {
    display: flex;
    flex-direction: column;
    gap: 16px;
    align-items: flex-start;
    justify-content: center;
    width: 100%;
    padding: 0 16px;
}

.card__footer {
    display: flex;
    gap: 16px;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: 16px var(--gap-4);
    background: var(--gray-50);
    border-top: 1px solid var(--border);
    border-bottom-left-radius: var(--radius-card);
    border-bottom-right-radius: var(--radius-card);
}

.card__footer--split > * {
    flex: 1 0 0;
    min-width: 0;
}

/* Text */
.text-caption {
    margin: 0;
    font-size: 12px;
    line-height: 18px;
    color: var(--labels-primary);
}

.text-caption--strong {
    font-weight: 600;
}

.text-secondary {
    color: var(--labels-secondary);
}

.text-error {
    color: var(--error-700);
    font-size: 11px;
    line-height: normal;
    margin: 0;
}

.list-plain {
    margin: 0;
    padding-left: 18px;
    font-size: 12px;
    line-height: 18px;
}

.list-plain ul {
    margin: 0;
    padding-left: 18px;
    list-style: disc;
}

/* Form controls */
.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    align-items: flex-start;
    width: 100%;
}

.form-field__label {
    margin: 0;
    font-size: 11px;
    font-weight: 500;
    line-height: normal;
    color: var(--labels-secondary);
}

.form-control {
    width: 100%;
    height: 28px;
    padding: 4px 12px;
    border: 1px solid var(--gray-300);
    border-radius: var(--radius-card);
    background: var(--background-base);
    color: var(--labels-primary);
    font-family: inherit;
    font-size: 12px;
    font-weight: 500;
    line-height: 18px;
}

.form-control::placeholder {
    color: var(--labels-tertiary);
    font-weight: 500;
}

.form-control:focus-visible {
    outline: 2px solid var(--buttons-primary);
    outline-offset: -1px;
}

.form-control--invalid {
    border-color: var(--error-700);
}

textarea.form-control {
    height: auto;
    resize: vertical;
}

.form-check {
    display: flex;
    gap: 8px;
    align-items: center;
    width: 100%;
}

.form-check input[type="checkbox"] {
    width: 12px;
    height: 12px;
    margin: 0;
    accent-color: var(--buttons-primary);
}

.form-check label {
    flex: 1 0 0;
    min-width: 0;
    font-size: 12px;
    line-height: 18px;
    font-weight: 500;
}

/* Buttons */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 28px;
    padding: 6px 8px;
    border-radius: var(--radius-control);
    border: 1px solid transparent;
    font-family: inherit;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
}

.btn--primary {
    background: var(--buttons-primary);
    border-color: var(--buttons-primary);
    color: #ffffff;
}

.btn--primary:disabled {
    background: var(--background-tertiary);
    border-color: var(--background-tertiary);
    color: #ffffff;
    cursor: default;
}

.btn--secondary {
    background: var(--background-base);
    border-color: var(--gray-300);
    color: var(--labels-primary);
}

.btn--link {
    background: none;
    border-color: transparent;
    color: var(--buttons-primary);
    width: 100%;
}

.btn--wide {
    width: 201px;
}

/* Progress bar */
.progress-bar {
    display: flex;
    align-items: center;
    width: 100%;
    height: 4px;
    border-radius: 9999px;
    background: var(--background-secondary);
    overflow: hidden;
}

.progress-bar__fill {
    height: 4px;
    background: var(--buttons-primary);
    animation: progress-indeterminate 1.6s ease-in-out infinite;
}

@keyframes progress-indeterminate {
    0% {
        width: 10%;
    }

    50% {
        width: 70%;
    }

    100% {
        width: 100%;
    }
}

/* Status rows */
.status-row {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    height: 28px;
    padding: 4px 8px;
    border: 1px solid var(--separator-opaque);
    border-radius: var(--radius-card);
    background: var(--success-25);
}

.status-row--failed {
    background: #fff5f6;
}

.status-row__label {
    flex: 1 0 0;
    min-width: 0;
    height: 18px;
    font-size: 12px;
    line-height: 18px;
    color: var(--labels-primary);
}

.status-list {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 100%;
}

.result-heading {
    display: flex;
    align-items: center;
    gap: 6px;
    width: 100%;
}

.result-heading__icon {
    display: block;
    width: 12px;
    height: 8.667px;
}

.stack-8 {
    display: flex;
    flex-direction: column;
    gap: 8px;
    align-items: flex-start;
    width: 100%;
}

/* Utilities */
.hidden {
    display: none !important;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Session timer, shown below the card */
.pwm-session {
    width: 486px;
    margin-top: 8px;
    text-align: center;
    font-size: 11px;
    color: var(--labels-secondary);
}

/* Status message banner (core errors, progress status) */
.status-message {
    width: 100%;
    padding: 8px 12px;
    border-radius: var(--radius-card);
}

.status-message--info {
    background: var(--background-secondary);
}

.status-message--success {
    background: var(--success-25);
}

.status-message--success .text-caption {
    color: var(--success-600);
}

.status-message--error {
    background: #fff5f6;
}

.status-message--error .text-caption {
    color: var(--error-700);
}

/* Determinate progress fill overrides the indeterminate animation */
.progress-bar__fill--determinate {
    animation: none;
    transition: width 0.3s ease;
}

.status-row--warning {
    background: #fffaeb;
}
