/*
 * Personelyar verified-mobile activation wizard (RTL-first, mobile-first).
 * Scoped to .pymobact; logical properties are used so the component does not
 * depend on the page direction. Reuses the existing Personelyar blue
 * (#2271b1) and inherits the theme font.
 */
.pymobact {
    --pm-primary: #2271b1;
    --pm-primary-dark: #1b5a8d;
    --pm-text: #1d2327;
    --pm-muted: #50575e;
    --pm-border: #8c8f94;
    --pm-surface: #f6f7f7;
    --pm-error: #a8232a;
    --pm-error-bg: #fcf0f1;
    --pm-success: #166534;
    --pm-focus: #1b5a8d;
    box-sizing: border-box;
    inline-size: 100%;
    max-inline-size: 440px;
    margin-inline: auto;
    color: var(--pm-text);
    font-size: 16px;
    line-height: 1.8;
    text-align: start;
}

.pymobact *,
.pymobact *::before,
.pymobact *::after {
    box-sizing: border-box;
}

.pymobact [hidden] {
    display: none;
}

.pymobact__title {
    margin: 0 0 12px;
    padding: 0;
    border: 0;
    color: var(--pm-text);
    font-size: 24px;
    font-weight: 700;
    line-height: 1.5;
}

.pymobact__subtitle {
    margin: 0 0 8px;
    padding: 0;
    border: 0;
    color: var(--pm-text);
    font-size: 18px;
    font-weight: 700;
    line-height: 1.6;
}

.pymobact__subtitle:focus {
    outline: 3px solid var(--pm-focus);
    outline-offset: 3px;
}

.pymobact__lead,
.pymobact__hint,
.pymobact__notice {
    margin: 0 0 16px;
    color: var(--pm-muted);
}

.pymobact__hint {
    margin: 6px 0 0;
    font-size: 14px;
    line-height: 1.7;
}

.pymobact__notice {
    padding: 12px 16px;
    border-radius: 8px;
    background: var(--pm-surface);
}

.pymobact__timer {
    display: inline-block;
    font-variant-numeric: tabular-nums;
}

/* Steps */
.pymobact__steps {
    display: flex;
    gap: 8px;
    margin: 0 0 20px;
    padding: 0;
    list-style: none;
}

.pymobact__step {
    flex: 1 1 0;
    display: flex;
    align-items: center;
    gap: 8px;
    min-inline-size: 0;
    padding: 8px;
    border-block-end: 3px solid #dcdcde;
    color: var(--pm-muted);
    font-size: 13px;
    line-height: 1.5;
}

.pymobact__step-num {
    flex: none;
    inline-size: 24px;
    block-size: 24px;
    border-radius: 50%;
    background: #dcdcde;
    color: var(--pm-text);
    font-size: 13px;
    font-weight: 700;
    line-height: 24px;
    text-align: center;
}

.pymobact__step-text {
    overflow-wrap: anywhere;
}

.pymobact__step.is-current {
    border-block-end-color: var(--pm-primary);
    color: var(--pm-text);
    font-weight: 700;
}

.pymobact__step.is-current .pymobact__step-num {
    background: var(--pm-primary);
    color: #fff;
}

.pymobact__step.is-done {
    border-block-end-color: var(--pm-success);
}

.pymobact__step.is-done .pymobact__step-num {
    background: var(--pm-success);
    color: #fff;
}

/* Status / error */
.pymobact__status {
    min-block-size: 0;
    position: absolute;
    inline-size: 1px;
    block-size: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}

.pymobact__error {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0 0 16px;
    padding: 12px 14px;
    border: 1px solid var(--pm-error);
    border-inline-start-width: 5px;
    border-radius: 8px;
    background: var(--pm-error-bg);
    color: var(--pm-error);
}

.pymobact__error:focus {
    outline: 3px solid var(--pm-focus);
    outline-offset: 2px;
}

.pymobact__error p {
    margin: 0;
    font-weight: 600;
}

.pymobact__error-icon {
    flex: none;
    inline-size: 22px;
    block-size: 22px;
    border-radius: 50%;
    background: var(--pm-error);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 22px;
    text-align: center;
}

/* Fields */
.pymobact__form {
    margin: 0;
}

.pymobact__field {
    margin: 0 0 18px;
}

.pymobact__field label {
    display: block;
    margin: 0 0 6px;
    color: var(--pm-text);
    font-size: 15px;
    font-weight: 600;
}

.pymobact__input {
    display: block;
    inline-size: 100%;
    min-block-size: 48px;
    padding: 10px 14px;
    border: 1px solid var(--pm-border);
    border-radius: 8px;
    background: #fff;
    color: var(--pm-text);
    font-family: inherit;
    font-size: 16px;
    line-height: 1.5;
    text-align: start;
}

.pymobact__input:focus {
    border-color: var(--pm-focus);
    outline: 3px solid var(--pm-focus);
    outline-offset: 1px;
    box-shadow: none;
}

.pymobact__input[aria-invalid="true"] {
    border-color: var(--pm-error);
    background: var(--pm-error-bg);
}

.pymobact__input--code {
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 0.35em;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

.pymobact__field-error {
    margin: 6px 0 0;
    color: var(--pm-error);
    font-size: 14px;
    font-weight: 600;
}

/* Buttons */
.pymobact__button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-block-size: 48px;
    padding: 10px 18px;
    border: 1px solid transparent;
    border-radius: 8px;
    font-family: inherit;
    font-size: 16px;
    font-weight: 700;
    line-height: 1.4;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.pymobact__button:focus-visible {
    outline: 3px solid var(--pm-focus);
    outline-offset: 2px;
}

.pymobact__button--primary {
    inline-size: 100%;
    background: var(--pm-primary);
    color: #fff;
}

.pymobact__button--primary:hover:not(:disabled) {
    background: var(--pm-primary-dark);
    color: #fff;
}

.pymobact__button--ghost {
    border-color: var(--pm-primary);
    background: #fff;
    color: var(--pm-primary-dark);
}

.pymobact__button--link {
    min-block-size: 44px;
    padding: 6px 4px;
    background: transparent;
    color: var(--pm-primary-dark);
    font-weight: 600;
    text-decoration: underline;
}

.pymobact__button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

.pymobact__actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin: 12px 0;
}

.pymobact__switch {
    margin: 20px 0 0;
    text-align: center;
}

/* Spinner (decorative; the label carries the meaning) */
.pymobact__spinner {
    display: none;
    inline-size: 18px;
    block-size: 18px;
    border: 3px solid rgba(255, 255, 255, 0.45);
    border-block-start-color: #fff;
    border-radius: 50%;
    animation: pymobact-spin 0.8s linear infinite;
}

.pymobact__button[aria-busy="true"] .pymobact__spinner {
    display: inline-block;
}

@keyframes pymobact-spin {
    to {
        transform: rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .pymobact__spinner {
        animation: none;
    }

    .pymobact__button {
        transition: none;
    }
}

/* Success */
.pymobact__success {
    text-align: center;
}

.pymobact__success-icon {
    display: inline-block;
    inline-size: 56px;
    block-size: 56px;
    margin-block-end: 8px;
    border-radius: 50%;
    background: var(--pm-success);
    color: #fff;
    font-size: 30px;
    line-height: 56px;
}

/* Host column: the generic auth layout padding is too wide for phones. */
.py-auth-form-container.pymobact-host {
    padding: 28px 16px;
}

@media (min-width: 601px) {
    .py-auth-form-container.pymobact-host {
        padding: 40px 50px;
    }
}

/* After success the alternative-method switch is irrelevant. */
.pymobact[data-state="success"] .pymobact__switch {
    display: none;
}

/* Organization-code panel hosting the existing form */
.pymobact-legacy[hidden] {
    display: none;
}

@media (max-width: 420px) {
    /* Only the current step keeps a visible label; the others stay in the
       accessibility tree through visually-hidden text. */
    .pymobact__step:not(.is-current) .pymobact__step-text {
        position: absolute;
        inline-size: 1px;
        block-size: 1px;
        overflow: hidden;
        clip-path: inset(50%);
        white-space: nowrap;
    }

    .pymobact__step:not(.is-current) {
        flex: 0 0 auto;
        padding-inline: 4px;
    }
}

@media (max-width: 380px) {
    .pymobact__title {
        font-size: 21px;
    }

    .pymobact__input--code {
        letter-spacing: 0.25em;
    }
}

@media (forced-colors: active) {
    .pymobact__button--primary {
        border-color: ButtonText;
    }
}
