/* Phone sign-in, SMS code and account phone forms. */

.uap-sr-only {
    position: absolute !important;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.uap-login-panel[hidden],
.uap-phone-step[hidden],
.uap-phone-captcha[hidden] {
    display: none !important;
}

/* Method tabs */
.uap-login-methods {
    display: flex;
    gap: 4px;
    margin: 0 0 18px;
    padding: 4px;
    border-radius: var(--uap-radius-sm, 8px);
    background: var(--uap-bg-secondary, #f4f4f2);
}

.uap-login-methods .uap-login-method {
    flex: 1 1 0;
    min-height: 36px;
    margin: 0;
    padding: 6px 12px;
    border: 0;
    border-radius: var(--uap-radius-sm, 8px);
    background: transparent;
    box-shadow: none;
    color: var(--uap-text-muted, #57534e);
    font-size: var(--uap-text-sm, 14px);
    font-weight: 500;
    line-height: 1.4;
    cursor: pointer;
}

.uap-login-methods .uap-login-method:hover {
    color: var(--uap-text, #1c1917);
}

.uap-login-methods .uap-login-method.is-active {
    background: var(--uap-surface, #fff);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08);
    color: var(--uap-text, #1c1917);
}

.uap-login-methods .uap-login-method:focus-visible {
    outline: 2px solid var(--uap-action-bg, #0e7a6d);
    outline-offset: 1px;
}

/* Phone input */
.uap-phone-input {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.uap-phone-input input[type="tel"] {
    flex: 1 1 auto;
    min-width: 0;
}

.uap-phone-prefix {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 0 12px;
    border: 1px solid var(--uap-border, #e7e5e4);
    border-radius: var(--uap-radius-sm, 8px);
    background: var(--uap-bg-secondary, #f4f4f2);
    color: var(--uap-text-muted, #57534e);
    font-size: var(--uap-text-sm, 14px);
}

.uap-phone-input select.uap-phone-region {
    flex: 0 0 auto;
    width: auto;
    max-width: 42%;
}

/* Captcha and code rows */
.uap-phone-captcha-row,
.uap-phone-code-row {
    display: flex;
    align-items: stretch;
    gap: 8px;
}

.uap-phone-captcha-row input,
.uap-phone-code-row input {
    flex: 1 1 auto;
    min-width: 0;
}

.uap-phone-captcha-refresh {
    display: inline-flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    margin: 0;
    padding: 0;
    border: 1px solid var(--uap-border, #e7e5e4);
    border-radius: var(--uap-radius-sm, 8px);
    background: var(--uap-surface, #fff);
    overflow: hidden;
    cursor: pointer;
}

.uap-phone-captcha-refresh img {
    display: block;
    width: 112px;
    height: auto;
}

.uap-phone-code-row .uap-phone-send {
    flex: 0 0 auto;
    min-width: 112px;
    margin: 0;
    padding: 0 14px;
    white-space: nowrap;
    font-size: var(--uap-text-sm, 14px);
}

.uap-phone-code-row .uap-phone-send:disabled {
    cursor: not-allowed;
    opacity: 0.65;
}

/* Consent notice below the submit button */
.uap-phone-consent {
    margin: 10px 0 0;
    color: var(--uap-text-muted, #57534e);
    font-size: var(--uap-text-xs, 12px);
    line-height: 1.6;
    text-align: center;
    overflow-wrap: anywhere;
}

.uap-phone-consent a {
    color: var(--uap-action-bg, #0e7a6d);
}

/* User hub section */
.uap-phone-current {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 8px;
}

.uap-phone-current-info {
    display: flex;
    align-items: center;
    gap: 8px;
}

.uap-phone-current-number {
    color: var(--uap-text, #1c1917);
    font-size: var(--uap-text-base, 15px);
    font-weight: 600;
    letter-spacing: 0.02em;
}

.uap-phone-verified {
    padding: 2px 8px;
    border-radius: 999px;
    background: var(--uap-success-bg, #ecfdf5);
    color: var(--uap-success, #15803d);
    font-size: var(--uap-text-xs, 12px);
}

.uap-phone-current-actions,
.uap-phone-step-actions {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.uap-phone-account .uap-phone-step {
    margin-top: 14px;
    padding-top: 14px;
    border-top: 1px solid var(--uap-border, #e7e5e4);
}

/* Login modal: keep the phone form aligned with the password form. */
.uap-login-modal .uap-login-methods {
    margin-bottom: 14px;
}

.uap-login-modal .uap-phone-prefix {
    border-radius: var(--uap-radius-md, 10px);
}

@media (max-width: 480px) {
    .uap-phone-code-row .uap-phone-send {
        min-width: 96px;
        padding: 0 10px;
    }

    .uap-phone-captcha-refresh img {
        width: 96px;
    }

    .uap-phone-input select.uap-phone-region {
        max-width: 48%;
    }
}
